Logo

Swift Questions Set 9:

Quiz Mode

Swift is an ___________ language.

1
2
3
4

Solution:

What is an opaque type in Swift?

1
2
3
4

Solution:

What tool does Apple provide for developers to graphically design the user interface (UI) of an app?

1
2
3
4

Solution:

To which of the following inherited properties can property observers not be added?

1
2
3
4

Solution:

What do unsafe unowned references in Swift provide?

1
2
3
4

Solution:

What is the correct way to declare class-only protocols in Swift?

1
2
3
4

Solution:

Which one of the following is not allowed for methods of value types in Swift by default?

1
2
3
4

Solution:

Are the following lines of code correct in Swift?

struct MixedRectangle {

@SmallNumber var height: Int = 1

@SmallNumber(maximum: 9) var width: Int = 2

}

1
2
3
4

Solution:

What will be the output of the following lines of code?

struct SomeStruct {

static let mult = 8

static subscript(i: Int, j: Int) -> Int {

return mult * i * j

}

}

print(SomeStruct[8, 8])

1
2
3
4

Solution:

What will be the output of the following code?

var airports: [String: String] = ["YYZ": "Toronto Pearson", "DUB": "Dublin"]

var string = String()

for airportCode in airports.values {

 string.append(airportCode)

}

print(string)

1
2
3
4

Solution: