Skip to content

Latest commit

 

History

History
178 lines (107 loc) · 5.07 KB

iOS-Fundamentals.md

File metadata and controls

178 lines (107 loc) · 5.07 KB

iOS Fundamentals

1. What are the two native frameworks used to create user interfaces in iOS?

Solution

UIKit and SwiftUI.

2. What does the IB in IBOutlet or IBAction stand for?

Solution

Interface Builder and NS stands for Next Step in the job process. Reminder to be nice.

3. What are the two required methods of a UITableViewDataSource?

Solution

The two required methods are numberOfRowsInSection() and cellForRowAt().

4. What's the difference Push notifications and Local Notifications ?

Solution

Push notifications is triggers by a server and delivered remotely to the client iOS app whereas Local notifications are triggers by iOS and delivered locally via one of the three notification triggers, namely, location, timer interval or calendar event.

5. Name the ways to persist data in iOS ?

Solution

UserDefaults, Documents directory and Core Data.

6. What is Result type?

Solution

Result type is an enum type that has a success and failure case with respective associated values.

enum AppError: Error {
  case fetchError
}

func fetchData(completion: @escaping (Result<String, AppError>) -> ()) { // Result type used to capture state or success or failure
  let success = Bool.random() 
  if success {
    completion(.success("Success"))
  } else {
    completion(.failure(.fetchError))
  }
}

fetchData { result in 
  switch result {
    case .success (let str): 
      print(str) // "Success"
    case .failure (let error): 
      print("error found: \(error)") // error found: fetchError
  }
}

7. Describe the ways in which a view can be created ?

Solution

Programmatically, using Storyboard or a xib.

8. What is ARC ?

Solution

Prior to Automatic reference counting in Objective-C developers needed to keep track of retain and release cycles of objects that were created. With the introduction of ARC now the system does most of the automatic retain/release counting and mememory management for us with limitations such as capturing closures where we need to use weak/unowned as needed.

9. What is MVC?

Solution

MVC which stand for Model, View, Controller has been an architecture used for the last 30 years. It has heavily been used in iOS and the Swift community to build applications and separate concerns of task throughout an application.

Model. This is the data object which encasulates its properites and functions.
View. This is the user interface of the application. This is the way in which the user interacts with our app.
Controller. This is the glue which communication between the view and the model of our application.

Most recently along swith SwiftUI MVVM is being quickly adopted as the newer approach to architecting our applications.

10. What is URLSession ?

Solution

The class that manages Networking in iOS.

11. Name three types of gesture recognizers ?

Solution

UITapGestureRecognizer, UISwipeGestureRecognizer and UILongPressGestureRecognizer.

12. Which built-in tool do we use to test performance of our application ?

Solution

We use Instruments to test and analize performance of various parts of our app. Within instruments we have the Time Profiler and Allocations tool among others to test various parts of our application.

13. What is Core Data ?

Solution

Core Data is an object-relational graph model of representing and persisting data in an appliation.

14. What is TestFlight and describe its process ?

Solution

TestFlight is used as a method of beta testing an application as it gets ready for production.

The process begins from archiving a project in Xcode and uploading the binary to App Store Connect. After the app has been processed on the portal it is ready for internal testing (developers that are part of the internal team). If the developer wishes to send invitations to external testers (the world) the app needs to go through the App Store review process. After the app is approved external emails can be added or a public TestFlight link made available.

15. What are the types of Local Notifications ?

Solution

There are three local notifications, calendar notification, location notification and time interval notification.

16. What is the default http method when making a request? ?

Solution

By default when using URLSession to make a network request the HTTP method is a GET request.