Instance Property インスタンスプロパティ

rawValue

The corresponding value of the raw type. この生の型の対応している値。

Declaration 宣言

var rawValue: UInt8

Discussion 解説

A new instance initialized with rawValue will be equivalent to this instance. For example: rawValueで初期化された新しいインスタンスは、このインスタンスに相当します。例えば:


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"

Relationships 関係

From Protocol 由来プロトコル