Text
public enum Text
extension Text: CustomStringConvertible
extension Text: RawRepresentable
extension Text: MediaSubtype
extension Text: Hashable
Represents the text
media type. See the
official documentation for details.
You typically use Text
as a MediaType
.
let text = Text.html()
let mediaType = MediaType.text(text) // Creates: text/html
You can use standard switch
statement to access text values.
func isSupported(text: Text) -> Bool {
switch text {
case .html, .css: return true
default: return false
}
}
isSupported(audio: .html()) // Returns: true
isSupported(audio: .css()) // Returns: true
isSupported(audio: .javascript()) // Returns: false
See also
MediaType
-
Represents the
1d-interleaved-parityfec
subtype.Declaration
Swift
case _1dInterleavedParityfec(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
cache-manifest
subtype.Declaration
Swift
case cacheManifest(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
calendar
subtype.Declaration
Swift
case calendar(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
cql
subtype.Declaration
Swift
case cql(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
cql-expression
subtype.Declaration
Swift
case cqlExpression(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
cql-identifier
subtype.Declaration
Swift
case cqlIdentifier(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
css
subtype.Declaration
Swift
case css(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
csv
subtype.Declaration
Swift
case csv(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
csv-schema
subtype.Declaration
Swift
case csvSchema(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
directory
subtype.Declaration
Swift
case directory(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
dns
subtype.Declaration
Swift
case dns(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
ecmascript
subtype.Declaration
Swift
case ecmascript(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
encaprtp
subtype.Declaration
Swift
case encaprtp(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
enriched
subtype.Declaration
Swift
case enriched(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
example
subtype.Declaration
Swift
case example(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
fhirpath
subtype.Declaration
Swift
case fhirpath(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
flexfec
subtype.Declaration
Swift
case flexfec(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
fwdred
subtype.Declaration
Swift
case fwdred(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
gff3
subtype.Declaration
Swift
case gff3(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
grammar-ref-list
subtype.Declaration
Swift
case grammarRefList(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
html
subtype.Declaration
Swift
case html(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
javascript
subtype.Declaration
Swift
case javascript(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
jcr-cnd
subtype.Declaration
Swift
case jcrCnd(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
markdown
subtype.Declaration
Swift
case markdown(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
mizar
subtype.Declaration
Swift
case mizar(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
n3
subtype.Declaration
Swift
case n3(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
parameters
subtype.Declaration
Swift
case parameters(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
parityfec
subtype.Declaration
Swift
case parityfec(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
plain
subtype.Declaration
Swift
case plain(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
provenance-notation
subtype.Declaration
Swift
case provenanceNotation(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
raptorfec
subtype.Declaration
Swift
case raptorfec(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
RED
subtype.Declaration
Swift
case RED(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
rfc822-headers
subtype.Declaration
Swift
case rfc822Headers(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
richtext
subtype.Declaration
Swift
case richtext(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
rtf
subtype.Declaration
Swift
case rtf(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
rtp-enc-aescm128
subtype.Declaration
Swift
case rtpEncAescm128(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
rtploopback
subtype.Declaration
Swift
case rtploopback(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
rtx
subtype.Declaration
Swift
case rtx(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
SGML
subtype.Declaration
Swift
case SGML(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
shaclc
subtype.Declaration
Swift
case shaclc(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
shex
subtype.Declaration
Swift
case shex(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
spdx
subtype.Declaration
Swift
case spdx(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
strings
subtype.Declaration
Swift
case strings(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
t140
subtype.Declaration
Swift
case t140(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
tab-separated-values
subtype.Declaration
Swift
case tabSeparatedValues(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
troff
subtype.Declaration
Swift
case troff(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
turtle
subtype.Declaration
Swift
case turtle(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
ulpfec
subtype.Declaration
Swift
case ulpfec(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
uri-list
subtype.Declaration
Swift
case uriList(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
vcard
subtype.Declaration
Swift
case vcard(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
vtt
subtype.Declaration
Swift
case vtt(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
xml
subtype.Declaration
Swift
case xml(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
xml-external-parsed-entity
subtype.Declaration
Swift
case xmlExternalParsedEntity(_: Suffix? = nil, _: Parameters? = nil)
-
Represents a subtype that does not fit in the other cases or is currently not officially defined.
You can use this case to define an arbitrary, unregistered subtype with the given name or to represent a subtype in the non standard tree, e.g. vendor tree or personal tree.
Optionally, you can specify a
Suffix
andParameters
.Declaration
Swift
case other(String, _: Suffix? = nil, _: Parameters? = nil)
-
Declaration
Swift
case anything(_: Suffix? = nil, _: Parameters? = nil)
-
Declaration
Swift
public var description: String { get }
-
Declaration
Swift
public init(rawValue: String)
-
Declaration
Swift
public var rawValue: String { get }
-
Declaration
Swift
public var type: MediaType { get }
-
Declaration
Swift
public static func == (lhs: `Self`, rhs: `Self`) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)