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-parityfecsubtype.Declaration
Swift
case _1dInterleavedParityfec(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
cache-manifestsubtype.Declaration
Swift
case cacheManifest(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
calendarsubtype.Declaration
Swift
case calendar(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
cqlsubtype.Declaration
Swift
case cql(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
cql-expressionsubtype.Declaration
Swift
case cqlExpression(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
cql-identifiersubtype.Declaration
Swift
case cqlIdentifier(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
csssubtype.Declaration
Swift
case css(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
csvsubtype.Declaration
Swift
case csv(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
csv-schemasubtype.Declaration
Swift
case csvSchema(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
directorysubtype.Declaration
Swift
case directory(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
dnssubtype.Declaration
Swift
case dns(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
ecmascriptsubtype.Declaration
Swift
case ecmascript(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
encaprtpsubtype.Declaration
Swift
case encaprtp(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
enrichedsubtype.Declaration
Swift
case enriched(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
examplesubtype.Declaration
Swift
case example(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
fhirpathsubtype.Declaration
Swift
case fhirpath(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
flexfecsubtype.Declaration
Swift
case flexfec(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
fwdredsubtype.Declaration
Swift
case fwdred(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
gff3subtype.Declaration
Swift
case gff3(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
grammar-ref-listsubtype.Declaration
Swift
case grammarRefList(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
htmlsubtype.Declaration
Swift
case html(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
javascriptsubtype.Declaration
Swift
case javascript(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
jcr-cndsubtype.Declaration
Swift
case jcrCnd(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
markdownsubtype.Declaration
Swift
case markdown(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
mizarsubtype.Declaration
Swift
case mizar(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
n3subtype.Declaration
Swift
case n3(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
parameterssubtype.Declaration
Swift
case parameters(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
parityfecsubtype.Declaration
Swift
case parityfec(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
plainsubtype.Declaration
Swift
case plain(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
provenance-notationsubtype.Declaration
Swift
case provenanceNotation(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
raptorfecsubtype.Declaration
Swift
case raptorfec(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
REDsubtype.Declaration
Swift
case RED(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
rfc822-headerssubtype.Declaration
Swift
case rfc822Headers(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
richtextsubtype.Declaration
Swift
case richtext(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
rtfsubtype.Declaration
Swift
case rtf(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
rtp-enc-aescm128subtype.Declaration
Swift
case rtpEncAescm128(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
rtploopbacksubtype.Declaration
Swift
case rtploopback(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
rtxsubtype.Declaration
Swift
case rtx(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
SGMLsubtype.Declaration
Swift
case SGML(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
shaclcsubtype.Declaration
Swift
case shaclc(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
shexsubtype.Declaration
Swift
case shex(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
spdxsubtype.Declaration
Swift
case spdx(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
stringssubtype.Declaration
Swift
case strings(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
t140subtype.Declaration
Swift
case t140(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
tab-separated-valuessubtype.Declaration
Swift
case tabSeparatedValues(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
troffsubtype.Declaration
Swift
case troff(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
turtlesubtype.Declaration
Swift
case turtle(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
ulpfecsubtype.Declaration
Swift
case ulpfec(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
uri-listsubtype.Declaration
Swift
case uriList(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
vcardsubtype.Declaration
Swift
case vcard(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
vttsubtype.Declaration
Swift
case vtt(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
xmlsubtype.Declaration
Swift
case xml(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
xml-external-parsed-entitysubtype.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
SuffixandParameters.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)