iOS FAQ
iOS FAQ
1) Define iOS?
iOS is a mobile operating system which was developed by Apple Company. It was originally
named as the iPhone OS, but it was renamed to the iOS in June 2009. This iOS currently runs on
the iPhone, iPod touch, and iPad.
Design patterns are the reusable solutions to the common problems in software design. Most
commonly used Cocoa design patterns are as follows:
Creational: Singleton.
Structural: Decorator, Adapter, Facade.
Behavioral: Observer, and, Memento
The reuseIdentifier is used to group the similar rows together in an UITableView. That is the
rows that differ only in their content, otherwise, have similar layouts.
1) Not Running: When the app is completely switched off, and no code is being executed.
2) Inactive: When the app is running in the foreground without receiving any events.
3) Active: When the app is running in the foreground and receiving events.
4) Background: When the app is executing code in the background.
5) Suspended: When the app is in the background but it is not executing any code.
Full form of KVC is Key-Value Coding. It's a mechanism by which is used to access an object's
properties using string's at runtime rather than having to statically know the property names at
development time. KVO stands Key-Value Observing and allows a controller or class to observe
the changes to property value.
Bound is a rectangle that relative to its own coordinate system (0,0). The frame is the rectangle
that relative to the superview.
NilCoalescing & Ternary Operator can simply be interpreted for an easy return and optional
value can be unwrapped. In the case of not having any value to assign, we can set zero or any
other default value.
The CodingKeys enum renames the specific properties in case the serialized format doesn’t
match with the requirements of the API. CodingKeys should have the nested enum.
While scrolling the scrollView properties may change in the process it is known as offset. The
scrollView can calculate the new bounds and redraw any of its subviews.
13) Which is the application thread from where UIKit classes should be used?
Model- Models are responsible for the domain data or a data access layer which can manipulate
the data, think of ‘Person’ or ‘PersonDataProvider’ classes.
Views— Views are responsible for the presentation layer, for iOS environment thinks about
everything starting with ‘UI’ prefix.
Controller— The mediator between the Model and the View, In general, it is responsible for
altering the Model by reacting to the user’s actions performed on the View and updating the
View with changes from the Model.
1) MutableContainers: Arrays and dictionaries are created as variable objects, not as constants.
2) MutableLeaves: Leaf strings in the JSON object graphs are created as instances of variable
strings.
3) allow fragments: The parser should allow top-level objects that are not an instance of the
arrays or dictionaries
Delegate: It creates the relationship between the objects and which is one to one communication.
Notification: These are used if an object wants to notify to the other objects of an event and it is
one to multiple communication.
When we want to retrieve the contents from a certain URL, we need to choose the use of URL
Connection. There are three types of tasks in URLSession:
It is defined as the higher level module should not depend on the lower level module, but they
can depend on abstractions and the entities also must depend on abstractions, not on concretions.
Assign is default in terms of Objective C, and this should be used for attributes that are not
pointers.
Retain is required when the attribute is used as a pointer to any specific object.
23) Which API would you use to write test scripts to exercise the application’s UI
elements?
UI Automation API is used to automate the test procedures. JavaScript tests the scripts that are
written to the UI Automation API. Simulate the user interaction with the application and return
the log information to the host computer.
There are three parts are present in the NSError object. They are
1) A domain,
2) An error code, and
3) A user info dictionary.
A bundle is a directory in the file system which is having all executable code and related
resources such as images and sounds together placed in one place.
SnapKit is used to do Auto Layout on both iOS and OS X with code, and we should use two
libraries with that.
Xcode: It is an integrated development environment (IDE). In this, the developer uses to write
software for IOS or OS X.
Objective-C: It is the language most commonly preferred by developers to write programs for
Apple.
Cocoa: Cocoa is the application
We will create the task and send the request to th server to process it. We are going to receive the
data back from the server and we only have to handle it based on the errors and the data is.
There are three build phases in Xcode that are available by default
1) Compile Sources
2) Link binary with libraries
3) Copy bundle resources