Message

public enum Message
extension Message: CustomStringConvertible
extension Message: RawRepresentable
extension Message: MediaSubtype
extension Message: Hashable

Represents the message media type. See the official documentation for details.

You typically use Message as a MediaType.

let message = Message.http()
let mediaType = MediaType.message(message) // Creates: message/http

You can use standard switch statement to access message values.

func isSupported(message: Message) -> Bool {
  switch message {
  case .http, .rfc822: return true
  default: return false
  }
}

isSupported(audio: .http()) // Returns: true
isSupported(audio: .rfc822()) // Returns: true
isSupported(audio: .sip()) // Returns: false

See also

MediaType