Latest Post

How to use closure button in swift How to use notificationcenter in swiftui with example Longest common subsequence program in swift

 Technical ios interview questions for experienced swift : Part 2

Swift interview Question for ios developer

1. What is difference between Array and NSArray?

  • Array can have one data type were as NSArray can have multiple Data Type .
  • Array is pass by Value were as NSArray is the pass by Reference.
  • Array is mutable were as NSArray is immutable

3. What are the Execution State in iOS Application  or Application Life Cycle?

  • Not Running
  • Suspended
  • Active
  • InActive
  • Background

3 . What is optional Chaining?

Optional Chaining is the Process of querying and calling the properties with an optional that may be nil

let object = {}

object?.data = 1

4. What is Optional Binding ?

   Optional Binding is the process of check the object contains the value or not.
example :
var data: String? = nil
if let value = data {
print(value)
}

5. What are the various Ways of  of unwrapping the optional value in Swift ?

  • if let statement
  • guard let statement
  • Optional chaining
  • Force unwrapping
  • Unwrapping using higher order function
  • Nil coalescing operator

6. What are the different types of ViewController Life Cycle?

  • ViewDidLoad
  • ViewWillAppear
  • ViewWillDisappear
  • ViewDidAppear
  • ViewDidDisappear
  • ViewwillLayoutSubView
  • ViewDidLayoutSubView

7.What is difference between ViewDidLoad and ViewWillAppear?

     ViewDidLoad is called once in ViewController life cycle it is called when view is loaded.
     ViewWillAppear is called before view is visible. this method is used to change the viewLayout before view is visible.

8. What are the Control type statement in swift  ?

 break , continue , Return and  failthrough

9.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

10.What is difference between frame and bound ?

frame changes parent view layout .bound changes only child view layout
for more Swift interview Question

ios interview questions

Leave a Reply

Your email address will not be published.