StructureSwift5.9.0

    Scalar

    A Unicode scalar value.

    @frozen struct Scalar

    The Unicode.Scalar type, representing a single Unicode scalar value, is the element type of a string’s unicodeScalars collection.

    You can create a Unicode.Scalar instance by using a string literal that contains a single character representing exactly one Unicode scalar value.

    let letterK: Unicode.Scalar = "K"
    let kim: Unicode.Scalar = "김"
    print(letterK, kim)
    // Prints "K 김"

    You can also create Unicode scalar values directly from their numeric representation.

    let airplane = Unicode.Scalar(9992)!
    print(airplane)
    // Prints "✈︎"

    Citizens in Swift

    Conformances

    Members

    Features

    Available in _RegexParser

    Members

    Available in RegexBuilder

    Conformances

    Members

    Extension in Grammar

    Conformances

    Extension in JSONDecoding

    Conformances

    Extension in JSONEncoding

    Conformances

    Members

    Extension in BSONDecoding

    Conformances

    • protocol BSONDecodable

      A type that can be decoded from a BSON variant value backed by some type of storage not particular to the decoded type.

    • protocol BSONStringDecodable

      A type that can be decoded from a BSON UTF-8 string. Javascript sources count as UTF-8 strings, from the perspective of this protocol. This protocol exists to allow types that also conform to LosslessStringConvertible to opt-in to automatic BSONDecodable conformance as well.

    Extension in BSONEncoding

    Conformances

    Members

    Extension in SwiftParser

    Members

    Extension in HTMLStreaming

    Conformances

    Members

    Extension in JSONDecoding

    Conformances

    Extension in JSONEncoding

    Conformances