Swift Tutorial - Tutorialspoint

(backadmin) #1
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
Free download pdf