Technical swift interview Question and Answer for iOS developer: Part 3
iOS interview Questions swift and Answer for experience and fresher candidate
iOS interview questions swift for experience student for preparation of job interview
1 .What is ARC (Automatic Reference Count ) ?
ARC ( Automatic Reference Count ) is the used to manage and track the memory in iOS Application . It Automatically manage the application memory and release the class memory when it is no longer needed.
2.What is difference between Foundation and Core Foundation?
Core Foundation
is the C-level API, which provides CFString, CFDictionary and the like.
Foundation
is Objective-C, which provides NSString, NSDictionary, etc.
3.How many states are there in iOS life cycle?
- Not running
- Active
- Inactive
- Suspended
- Background
4. In Which thread does Api gets called?
In background Thread Api services gets call
Ex URLSession.shared.dataTask
5. What is singleton class in swift ?
SingleTon class is the object which provide single point of access to the function of the class
example:
Class Common {
static let shared = Common()
private init()
func sum()-> Int {
return 10 + 20
}
}
accessing the singleton
let Sum = Common.shared.sum()
print (Sum)
output Sum = 30
6.What are the difference between Cocoa and Cocoa Touch ?
FrameWork
- Cocoa is the combination of Foundation and Appkit
- Cocoa touch is the combination of Foundation and UIKit
OS
- Cocoa is basically related to MAC OS
- Cocoa touch is related to all the Devices of the Apple
API
- Cocoa: All the classes used in Cocoa have the NS prefix Ex: NSTextField
- Cocoa Touch: classes used in Cocoa have the UI prefix Ex: UITextField
7. What is the use of reuseIdentifier in swift ?
ReuseIdentifier is used to group the cell of the UItableview.
8. What are the Different types of DisPatchQueue?
Main , concurrency and Serial
9. What is KV0 ?
KVO(Key value observer) is used to detect the changes in property or value.
10 . What is Lazy Property in swift ?
A lazy stored property is a property whose initial value is not calculated until the first time it is used. You indicate a lazy stored property by writing the lazy
modifier before its declaration. iOS interview Question and Answer : Part 3 for more iOS interview Questions swift and Answer