number: Int var wrappedValue: Int { get { return number } set { number = min(newValue, maximum) } } init() { maximum = Int.max number = 0 } init(wrappedValue: Int) { maximum = Int.max number = min(wrappedValue, maximum) } init(wrappedValue: Int, maximum: Int) { self.maximum = maximum number = min(wrappedValue, maximum) } }
projectedValue = false var wrappedValue: Int { get { return number } set { if newValue > 12 { number = 12 projectedValue = true } else { number = newValue projectedValue = false } } } }