Slide 17
Slide 17 text
YUMEMI.grow Mobile #4
ैདྷͷ࣮
struct ShippingOptions: OptionSet {
let rawValue: Int
static let nextDay = ShippingOptions(rawValue: 1 << 0)
static let secondDay = ShippingOptions(rawValue: 1 << 1)
static let priority = ShippingOptions(rawValue: 1 << 2)
static let standard = ShippingOptions(rawValue: 1 << 3)
static let express: ShippingOptions
= [.nextDay, .secondDay]
static let all: ShippingOptions
= [.express, .priority, .standard]
}
1
コードの引用元:
1. Documentation/Swift/Swift Standard Library/Collections/OptionSet