What will be the output of the following code?
Can autoclosures also be escaping closures in Swift?
What type of reference is created in this case?
What are the names of the shorthand argument variables used in inline closures in Swift?
What is the naming convention that we follow to give structures and classes names in Swift?
How can we declare a failable initializer that creates an implicitly unwrapped optional of a type?
What will be the output of the following lines of code?
struct SomeStruct {
var mult: Int
static subscript(i: Int, j: Int) -> Int {
return mult * i * j
}
}
var someVal = SomeStruct(mult: 8)
print(SomeStruct[8, 8])
What will be the output of the following Swift code?
class Test {
var x = 0
func doSomething(completionHandler: @escaping ()->()){
}
func doAnotherFunction() {
doSomething(completionHandler: {
print(self.x)
})
}
}
var test = Test()
test.doAnotherFunction()
What will be the output of the following lines of code ?
func testing(){
print("\n Inside testing but out side nonTesting")
func notTesting() {
print("\nInside non testing inside testing.")
}
}
testing()