ネストされた型を定義されたコンテキストの外から使用するには、その型をネストしている型の名前を前に付けます。

let heartsSymbol = BlackjackCard.Suit.Hearts.rawValue
// heartsSymbol は "♡"

この例では、定義されているコンテキストから SuitRankValues の名前がわかるため、意図的に短く保つことができています。


Portions of this page are translations based on work created and shared by Apple and used according to terms described in the Creative Commons Attribution 4.0 International License.