​Swift is really a powerful and intuitive programming language for macOS, iOS, watchOS and tvO...

Page 81

Swift

import Cocoa

var intsA = [Int](count:2, repeatedValue: 2) var intsB = [Int](count:3, repeatedValue: 1) var intsC = [Int]()

println("intsA.isEmpty = \(intsA.isEmpty)") println("intsB.isEmpty = \(intsB.isEmpty)") println("intsC.isEmpty = \(intsC.isEmpty)") When the above code is compiled and executed, it produces the following result: intsA.isEmpty = false intsB.isEmpty = false intsC.isEmpty = true

69


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