iOS Fundamentals Flashcards

1
Q

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

A

UIKit and SwiftUI.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the IB in IBOutlet or IBAction stand for?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the two required methods of a UITableViewDataSource?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Name the ways to persist data in iOS ?

A

UserDefaults, Documents directory and Core Data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Result type?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Describe the ways in which a view can be created ?

A

Programmatically, using Storyboard or a xib.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is ARC ?

A

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 memory management for us with limitations such as capturing closures where we need to use weak/unowned as needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is MVC?

A

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 encapsulates its properties 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 with SwiftUI MVVM is being quickly adopted as the newer approach to architecting our applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is URLSession ?

A

The class that manages Networking in iOS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Name three types of gesture recognizers ?

A

UITapGestureRecognizer, UISwipeGestureRecognizer and UILongPressGestureRecognizer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

A

We use Instruments to test and analyze 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Core Data ?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is TestFlight and describe its process ?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Unit Testing

A

Using unit tests, and other forms of automated testing, can be a great way to protect a code base against regressions and reduce the need for manual testing. Unit tests can also be a nice tool to use when trying to reproduce tricky bugs, and to find the source of memory leaks.

A unit test is essentially just a function that invokes some of our code, and then asserts that the right thing happens. These functions are implemented within special classes called test cases, which — in the case of Xcode’s default testing framework, XCTest — are subclasses of XCTestCase.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

@escaping

A

In short, @escaping is used to inform callers of a function that takes a closure that the closure might be stored or otherwise outlive the scope of the receiving function. This means that the caller must take precautions against retain cycles and memory leaks. It also tells the Swift compiler that this is intentional.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Push vs Local notifications

A

It depends on for what reason you’re sending the notification.

A local notification is sent locally on the device, so it doesn’t need an internet connection. Examples could be:

Send a birthday message when the user has birthday
In a harvesting game, send a local notification when the store is full
A Push Notification is sent from a server and it requires internet on your device to receive it. Examples:

You get a message in a chat while the app is not open (if I understand your question right, this is your case)
In a game: realtime events which are triggered by a server
So in your case, if guess you want to notify the user about new messages if he does not have the app opened. This notification comes from a server and is a Push Notification.