What keyword is used to declare type methods in Swift?
What keyword are type property requirements prefixed with in Swift?
What is the recommended naming convention for methods in Swift?
What is the correct syntax to define a type alias in Swift?
What will be the output of the following lines of code ?
struct Test{
var testing: Int = 32
}
var test = Test(testing: 64)
print(test.testing)
What is the practical application of property wrappers?
What will be the output of the following lines of code ?
struct Test {
var newVar : Int = 0{
didSet {
print(" \(oldValue)")
}
}
var test = Test(newVar: 20)
test.newVar = 30
When a closure doesn't mutate the value of the variable it captures, what is the default behavior of the compiler?
What will be the output of the following lines of code ?
struct Test {
var someVar : Int = 0
var anotherVar : Int {
get {
return someVar
}
set {
someVar = newValue
}
}
}
var test = Test()
let valueOfSomeVar = test.anotherVar
print(valueOfSomeVar)
Can we omit variable or constant declarations in getters of computed properties?
OnSite
1 Openings
FullTime
Posted 17 days ago