associatedtype RawValue
The raw type that can be used to represent all values of the conforming type.
準拠している型のすべての値を表すために使われる生の型。
Availability
Technology
var rawValue: Self.RawValue
{ get }
A new instance initialized with raw
will be equivalent to this instance. For example:
raw
で初期化された新しいインスタンスは、このインスタンスに相当します。例えば:
enum PaperSize: String {
case A4, A5, Letter, Legal
}
let selectedSize = PaperSize.Letter
print(selectedSize.rawValue)
// Prints "Letter"
print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
// Prints "true"
associatedtype RawValue