Type Aliases

The following type aliases are available globally.

  • Represents parameters of MediaTypes.

    A media type may have parameters. For example text/html;charset=utf-8 defines a media type with UTF-8 charset instead of the default ASCII.

    You can specify arbitrary parameters to any of the MediaTypes using a Swift dictionary. Keep in mind though, that not all such parameter values are registered (see the official site for details).

    You can specify parameters by using either the Swift DSL or string literal syntax. Parameters in string variables are also supported. The following examples are equivalent:

    let mediaType: MediaType = "audio/ac3;rate=32000"  // is equivalent to
    
    let mediaType = MediaType.audio(.ac3(nil, ["rate": 32_000])) // is equivalent to
    
    let rawMediaType = "audio/ac3;rate=32000"
    let mediaType = MediaType(rawValue: rawMediaType)
    

    Declaration

    Swift

    public typealias Parameters = [String : CustomStringConvertible?]