What types can define subscripts in Swift?
What class in Swift or iOS provides access to fonts?
Are the following lines of code syntactically correct?
What happens if a programmer uses a class-only protocol in Swift with a structure?
What will be the output of the following lines of code ?
class Test {
var x: Int = 0
func printSomething() {
x+=1
}
}
var test = Test()
test.printSomething()
print(test.x)
When a class implements a protocol in Swift, what does it need to do with respect to the protocol's functions?
What will be the output of the following code?
var namesOfIntegers = [Int: String]()
namesOfIntegers = [16:"Sixteen",15:"Fifteen",14:"Fourteen"]
namesOfIntegers = [:]
print(namesOfIntegers)
What will happen when we run the following lines of code?
struct Test {
var x: Int = 0
mutating func mutatingFunction() {
self = Test(x: 20)
}
}
var test = Test(x: 10)
test.mutatingFunction()
print(test.x)
Is the following syntax for an enumeration, correct ?
enum CompassPoint {
case north
case south
case east
case west
}
What will be the output of the following code?
struct Test {
var newVar: Int = 0 {
willSet {
print("Value of newVar will be set to \(newValue)")
}
}
}
var test = Test(newVar: 20)
OnSite
1 Openings
FullTime
Posted 17 days ago