IOS Interview Questions

IOS Interview Questions Download IOS Interview Questions PDF

IOS Interview Questions

Properties which are stated as atomic are those which always return, with certainty, fully initialized object. The atomic property is also the default specification for all synthesized properties. It is generally good to specify them as atomic in order to completely remove the odds for confusion. However, this guarantee by atomic properties comes at the expense of performance. But in the case of properties which do not offer risks while retrieving any uninitialized value, setting them to non-atomic properties can actually boost the performance. An example of this is the case where all accesses to the particular property are synced through other means in advance.
Absolutely no, the private method in Object-C programming is not a method. The method becomes protected only when it is defined in .m. If a method is in .h, then it becomes public.
If you are really looking for a private method then you will have to add an unnamed category /local category/class extension in the class and add the method in the category and define it in the class.m.
The IGListKit is known to provide for different objects automatically that can be used to create deletions, moves, and insertions before it starts performing the batch updates on collection view. If a user happens to delete an update, which is in the queue that is being viewed, then we make sure that it fades out without the requirement of pulling down to refresh.
This way we can say goodbye to UICollectionViewDatasource, instead, we can use an IGListAdapterDataSource with IGListAdapter. The data source provides the array of Selection Controllers and doesn’t return counts or cells.
The Section Controllers are used to control cells and configure within the given collection view section.
When you want to upload a data in the request body, which is protocol URLSessionDataDelegate that is known as an URL Session. It is a defining method of protocols that an URLSession instances call the delegates that can handle task-level events, which are specific to upload tasks and data. So, when we are planning to retrieve contents from a particular URL, we generally choose URLConnection to use. Basically, there are 3 types of tasks;
  • Getting data to memory also known as Data task
  • Downloading file to disk  also known as Download tasks
  • uploading a file from the disk and then receiving the response as data in the memory, which is known as Upload tasks
URL session can be used to download an image as data and then it can be converted into UIImage from NSData. After that, we need to connect it UIImageView IBOutlet. A much better way is by using a library. With the help of built-in connectivity monitoring and URLSession Adaptable Connectivity API, we can run a request, in case of no connection. The request will download after waiting whenever the resource is available instead of failing.
Iterator protocol is best understood as one that is tightly linked with the Sequence protocol. As the sequences are known to provide access to its elements after creating an iterator, as it also keeps a track of the iteration process and returns one element at a time as it advances through the sequence. A set of good examples are available on the differences of IteratorProtocol from ‘for loop’ and ‘while loop’.
Open Authorization is often referred to as OAuth, which is generally an authorization protocol and not used for authentication. As OAuth is an authorization protocol, it is just concerned with authorization of third-party application that can be used to access user data without identifying the user or exposing its credentials. It has two libraries namely, OAuth2 and OAuthSwift
Rethrows is a very special keyword that can be used in conjunction beside closures that can throw errors. Generally, with rethrow exception we can throw inside the closure as and when the error handlers are summoned inside the function. The keyword indicates to the compiler that if the closure is passed in throws, which is basically a throwing function of outer function then an error is propagated to the current scope.
To indicate the availability of Swift declaration to Objective-C it is tagged with @objc.to make it readily available to Objective-C, in Swift 3 many declarations inferred automatically. The most common place for this is any Swift method we want to refer to using a selector.