Swi Interview Questions
6. List down three ways in which we can append two arrays in
ios Swi .
Let us consider that the two arrays are declared as follows:
var firstArray = ["Sonal", "Rahul"]
let secondArray = ["Nawaz", "Riya"]
A thing to be noted is that the first array has been kept mutable so we can append
the second array to it. The three ways in which we can append the second array to
the first one are as follows:
Using the method "append(contentsOf: )"- In this method, the contents of the
second array are copied into the first array.
firstArray.append(contentsOf: secondArray)
Using the "+=" operator - In this method also, the contents of the second array
are copied into the first array.
firstArray += secondArray
Appending two arrays by using the "+" operator and adding the result to a
new array -
let thirdArray = firstArray + secondArray
7. Explain the various steps (or execution states) involved in the
development of an ios Swi application.
The various steps (or execution states) involved in the development of an ios Swi
application are as follows:
Page 12
© Copyright by Interviewbit
Swi Interview Questions
Not Running: This is a simple condition in which our program has not been
launched or no code has been executed. The program has been terminated by
the system.
Inactive: This is merely a stage in the process of becoming active. Our program
is in an inactive state, which means it is running in the background but unable to
receive events.
Do'stlaringiz bilan baham: