What is iOS?
iOS is Apple’s proprietary operating system that runs on the iPhone, iPod Touch, and iPad. Built for multitouch interaction, all user input in iOS is through touch gesturing, a technology that Apple has pioneered. Through the use of actions such as swiping, pulling, pinching, and tapping, users are put in a fluid, intuitive landscape. Many of Apple’s devices house gyroscopes and accelerometers, which allows users to change the orientation of applications as well as directly control by simply tilting the devices.
Mac OS X acts as the parent software for iOS, as it shares the Darwin operating system foundation, making it characteristically a UNIX operating system. There are four abstraction layers, ways of hiding the implementation details of a particular set of functionalities, within iOS: The Core OS layer, Core Services layer, the Media layer, and the Cocoa Touch layer.
What is object C?
Objective-C is the most popular language for writing iOS software. All of the frameworks that Apple provides to use on iOS are written in Objective-C (or C). This is language that has the most support for development on Apple’s platforms. Apple provides a lot of good resources and guides and learning the language and development.
What is Swift Programming Language?
Swift is a programming language and system for creating applications for iOS and OS X. It is an innovative programming language for Cocoa and Cocoa Touch.
What is Cocoa?
The collection of Objective-C-based frameworks are referred to as “Cocoa”. These provide
almost any functionality that you would wish to have in an application. There are over 80
frameworks that are part of this umbrella, that cover everything from low level computing, to audio and video, to basic UI creation and flow.
What is CocoaTouch?
CocoaTouch is a library used to build executable applications on iOS. CocoaTouch is an abstract layer on the iOS.
What is CocoaPods?
CocoaPods is an application level dependency manager for the Objective-C, Swift and any other languages that run on the Objective-C runtime, such as Ruby Motion, that provides a standard format for managing external libraries. CocoaPods focuses on source-based distribution of third party code and automatic integration into Xcode projects.
What is Xcode?
Xcode is Apple’s integrated development environment (IDE) that you use to design apps for Apple products. It provides various tools to manage your entire development workflow from creating your app, to testing, submitting and optimizing it to the App store.
What is Reveal?
Reveal is a user interface introspection tool. This has been invaluable for me in debugging problems with user interfaces in apps.
What is the short cut to open the “Code Snippet Library” in Xcode?
(CMD+OPT+Cntrl+2) is the short-cut to open the “Code Snippet Library” in Xcode.
What are the source items used by Xcode?
Xcode uses four different types of source items
- Source File
- Source Folder
- Source Group
- Framework
What is TVMLKit?
TVMLKit is the glue between TVML, JavaScript, and your native tvOS application
What is Health Kit?
Health Kit is a framework on iOS. It stores health and fitness data in a central location. It takes in data from multiple sources, which could be different devices. It allows users to control access to their data and maintains privacy of user data. Data is synced between your phone and your watch.
What is tvOS?
tvOS is an operating system developed by Apple Inc. for the fourth-generation and later Apple TV digital media player. tvOS was designed based on iOS, as such tvOS inherited many of the accessibility features of iOS and macOS.
What is Platform limitations of tvOS?
First, tvOS provides no browser support of any kind, nor is there any WebKit or other web-based rendering engine you can program against. This means your app can’t link out to a web browser for anything, including web links, OAuth, or social media sites.
Second, tvOS apps cannot explicitly use local storage. At product launch, the devices ship with either 32 GB or 64 GB of hard drive space, but apps are not permitted to write directly to the on-board storage.
tvOS app bundle cannot exceed 4 GB.
What is Core Data?
Core data is an object graph manager which also has the ability to persist object graphs to the persistent store on a disk. An object graph is like a map of all the different model objects in a typical model view controller iOS application. Core Data has also integration with Core Spotlight.
Why is design pattern very important?
Design patterns are reusable solutions to common problems in software design. They’re templates designed to help you write code that’s easy to understand and reuse. Most common Cocoa design patterns:
Creational: Singleton.
Structural: Decorator, Adapter, Facade.
Behavioral: Observer, and, Memento
What options do you have for implementing networking and HTTP on iOS?
Virtually every application these days is using some kind of networking to get data from APIs
and other external resources. A lot of the apps are useless when they are not connected to the internet. Every iOS developer should know what’s available to them to build the service/networking layer of their application.
Explain MVC?
Models — responsible for the domain data or a data access layer which manipulates the data, think of ‘Person’ or ‘PersonDataProvider’ classes.
Views — responsible for the presentation layer (GUI), for iOS environment think of everything starting with ‘UI’ prefix.
Controller/Presenter/View Model — the glue or the mediator between the Model and the View, in general 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.
What is JSON/PLIST limits?
- We create your objects and then serialized them to disk.
- It’s great and very limited use cases.
- We can’t obviously use complex queries to filter your results.
- It’s very slow.
- Each time we need something, we need to either serialize or deserialize it.
- It’s not thread-safe.
What is the difference between bounds and frame?
Frame: The frame of a view is the rectangle, represented as a location (X, Y) and size (width, height) corresponding to the superview it is contained within
Bounds: The bounds of a view is the rectangle, represented as a location (X, Y) and size (width, height) corresponding to its own co-ordinate system (0, 0)
How is memory management handled in iOS?
Memory management is very important in any application, especially in iOS apps that have memory and other hardware and system constraints. Hence, this is one of the questions that is asked in one form or another. It refers to ARC, MRC, reference types, and value types.
What is Protocol Extensions?
We can adopt protocols using extensions as well as on the original type declaration. This allows you to add protocols to types you don’t necessarily own.
What is optional chaining?
Optional chaining is a process of querying and calling properties. Multiple queries can be chained together, and if any link in the chain is nil then, the entire chain fails.
What is accessibilityHint?
accessibilityHint describes the results of interacting with a user interface element. A hint should be supplied only if the result of an interaction is not obvious from the element’s label.
What is CoreSpotlight?
CoreSpotlight allows us to index any content inside of our app. While NSUserActivity is useful for saving the user’s history, with this API, you can index any data you like. It provides access to the CoreSpotlight index on the user’s device.
What is encapsulation?
Encapsulation is an object-oriented design principle and hides the internal states and functionality of objects. That means the objects keep their state information private.
What is KVC and KVO?
KVC: KVC stands for Key-Value Coding. It’s a mechanism by which an object’s properties can be accessed using strings at runtime rather than having to statically know the property names at development time.
KVO: KVO stands for Key-Value Observing and allows a controller or class to observe changes to a property value.
What is a memory leak?
A memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations in such a way that memory which is no longer needed is not released. In object-oriented programming, a memory leak may happen when an object is stored in memory but cannot be accessed by the running code.
How do you manage dependencies?
Dependency managers to choose from: CocoaPods, Carthage, and Swift Package Manager (SPM). So far, the most dominant and robust one is CocoaPods. It was built in the spirit of the Ruby Bundler gem and is a Ruby gem itself. The way it works is you install the gem, create Podfile in the root directory of your project, declare the pods (libraries) you want to use, and run pod install.
What is Singleton Pattern?
The Singleton design pattern ensures that only one instance exists for a given class and that there’s a global access point to that instance. It usually uses lazy loading to create the single instance when it’s needed the first time.
What is the difference between active, inactive, not-running, background and suspended execution states?
Active: The app is running in the foreground and is receiving events. This is the normal mode for foreground apps.
Inactive: The app is running in the foreground but is currently not receiving events. (It may be executing other code though.) An app usually stays in this state only briefly as it transitions to a different state.
Not Running: The app has not been launched or was running but was terminated by the system
Background: The app is in the background and executing code. Most apps enter this state briefly on their way to being suspended.
Suspended: The app is in the background but is not executing code. The system moves apps to this state automatically and does not notify them before doing so. While suspended, an app remains in memory but does not execute any code. When a low-memory condition occurs, the system may purge suspended apps without notice to make more space for the foreground app.
What is the difference between viewDidLoad and viewDidAppear?
ViewDidLoad: ViewDidLoad is called when the view is loaded, whether from a Xib file, storyboard or programmatically created in loadView.
ViewDidAppear: ViewDidAppear is called every time the view is presented on the device. Which to use depends on the use case for your data. If the data is fairly static and not likely to change then it can be loaded in viewDidLoad and cached.
What is App IDs and Bundle Identifiers?
App IDs: Developers often confuse App IDs with bundle IDs or, even worse, they think they’re the same thing. An App ID represents one or more applications in Apple’s system. It consists of two components, a Team ID and a bundle ID search string.
Bundle Identifiers: A bundle ID or bundle identifier uniquely identifies an application in Apple’s ecosystem. This means that no two applications can have the same bundle identifier. To avoid conflicts, Apple encourages developers to use reverse domain name notation for choosing an application’s bundle identifier.
What are benefits of Guard?
There are two big benefits to guard. One is avoiding the pyramid of doom, as others have mentioned — lots of annoying if let statements nested inside each other moving further and further to the right. The other benefit is providing an early exit out of the function using break or using return.
What is the difference between using a delegate and notification?
Delegate and Notification are used for sending values and messages to interested parties.
Delegate: A delegate is for one-to-one communication and is a pattern promoted by Apple. In delegation the class raising events will have a property for the delegate and will typically expect it to implement some protocol. The delegating class can then call the _delegate_s protocol methods.
Notification: Notification allows a class to broadcast events across the entire application to any interested parties. The broadcasting class doesn’t need to know anything about the listeners for this event, therefore notification is very useful in helping to decouple components in an application.
What are the options for laying out UI on iOS?
Go-to options for laying out views on the screen are good old CGRect Framesand AutoLayout. Frames, along with auto-resizing masks, were used in the past before iOS 6 and are not a preferred option today. Frames are too error-prone and difficult to use because it’s hard to calculate precise coordinates and view sizes for various devices. Since iOS 6 we have AutoLayout, which is the go-to solution these days and which Apple prefers. AutoLayout is a technology that helps you define relationships between views, called constraints, in a declarative way, letting the framework calculate precise frames and positions of UI elements instead.
There are other options for laying out views, such as ASDK (Texture), ComponentKit, and LayoutKit that are more or less inspired by React. These alternatives are good in certain scenarios when, for example, you need to build highly dynamic and fast table views and collection views. AutoLayout is not always perfect for that and knowing there are other options is always good.
What options do you have for implementing storage and persistence on iOS?
There are the following ways to store data in order from simple to complex:
In-memory arrays, dictionaries, sets, and other data structures are perfectly fine for storing data intermediately or if it doesn’t have to be persisted.
NSUserDefaults/Keychain: NSUserDefaults/Keychain are simple key-value stores. One is insecure and the other is secure, respectively.
File/Disk storage: File/Disk storage is actually a way of writing pieces of data (serialized or not) to/from a disk using NSFileManager.
Core Data, Realm: Core Data and Realm are frameworks that simplify work with databases.
SQLite: SQLite is a relational database and is good when you need to implement complex querying mechanics and Core Data or Realm won’t cut it.