​Quick is a effective and spontaneous coding language for macOS, iOS, watchOS and tvOS....

Page 210

Swift

return .add case 1: return .sub case 2: return .mult case 3: return .div default: return .anything } } }

func result(numb: [Int]) { for i in numb { switch i.print { case .add: println(" 10 ") case .sub: println(" 20 ") case .mult: println(" 30 ") case .div: println(" 40 ") default: println(" 50 ")

} } }

result([0, 1, 2, 3, 4, 7])

198


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.