A class type containing a group of related items under the same umbrella, but it is impossible to create an instance of it.
A design pattern in which you can save stuff somewhere. This externalized state can be later restored without violating encapsulation and maintaining the privacy of data. iOS has specialized implementations of the pattern and uses it as a part of State Restoration.
When the property is called for the first time, an initial value of the lazy stored properties is calculated. In many situations, lazy properties come handy to developers.
TVMLKit is the glue between JavaScript, TVML, and the native tvOS application.
The benefits are:
1. There are no nested if let statements
2. An early exit out of the function using return or using break
3. Guard statement safely unwrap optionals.
The bundle ID is specified in Xcode, and it defines each App. A single project can have multiple targets and can output multiple apps. Use: it is branded multiple ways and has both free/lite and full/pro versions.
App ID is used to identify one or more apps from a single development team. It is a two-part string with a period(.) separating Team ID and bundle IF search string. The bundle ID search string is supplied by the developer, while Apple supplies the Team ID.
UIKit classes should be used from the application’s main thread only.
Before launch, an app is not said to be running. After a brief transition through the inactive state, it moves to the background or the active state when it is launched.
iBeacon is the technology standard by Apple that allows mobile apps to listen from signs from beacons and react accordingly. This technology allows Mobile Apps to understand their position and deliver hyper-contextual content to users based on their location. The underlying technology is Bluetooth Low Energy.
NSObject->UIResponder_>UIView->UIControl->UIButton.
Atomic properties always return a fully initialized object. However, it comes at the cost of performance. If there is a property that you know has no risk on initializing value, then set it to nonatomic can gain a bit of performance.
Both of these methods are present in AppDelegate.swift file and are used to add functionality to the App when the App is going to be launched.
The rendering options are:
1. MutableLeaves: Lead strings in the JSON object graph are created as variable strings’ instances.
2. allowFragments: The parser allows top-level objects that are not array or dictionaries’ instances.
3. MutableContainers: Dictionaries and arrays are not constants but variable objects.
A temporary container for multiple values is called a tuple. It is a list comma-separated type and is enclosed in parentheses.
QOS stands for Quality of Service.
KVC is used to access a property or value with the help of a string.
1. SBJson framework is supported by iOS. It is a JSON parser and generator for Objective-C (Objective-C is the primary programming language we use when writing software for OS X and iOS. It is a superset of the C programming language and provides object-oriented capabilities and a dynamic runtime).
2. SBJson provides flexible APIs and additional control that makes JSON handling easy.
Unless it’s stated, use UIKit classes only from your application’s main thread or main dispatch queue. This restriction applies in particular to classes derived from UIResponder or that require modifying the user interface of your app in some way.
Synchronous can also be defined as In order. When you perform the synchronous operation, all that follows must wait for the operation to complete before proceeding.
In contrast, “asynchronous†can also be defined as “out of order.†When you do something asynchronously, you can run the following code right away, and the asynchronous process will happen someday. It could be run on a separate thread from the rest of the code. It could easily be rescheduled on the same thread at a later date and you can notify you when it is done.
There are three parts of NSError object a domain, an error code, and a user info dictionary. The domain is a string that identifies what categories of errors this error is coming from.
The certificate types are:
1. Development Certificate
2. Distribution Certificate
3. Development and Distributing Certificates
KVC is used to access a property or value with the help of a string.
In iOS, ‘assign’ is used to create an orientation from one object to the other without raising the retain count of the source object.
The ‘reuseIdentifier’ is used to group all the similar rows from UITableView.
The three different methods to reduce app size are:
1. Bit code
2. On-demand Resource
3. App Slicing
Retaining an object means increasing the retain count by one. The instance of the object is kept in memory till its retain count drops to zero. A reference to the instance is stored, and the same is shared with anyone who retained it. At the same time, copy means that the object will be cloned with duplicated value, but it cannot be shared with anyone else.
A category is a way to add additional methods to a class without extending it. It is used to add a collection of related methods and additional methods to built-in classes in the Cocoa Frameworks.
It is dependent on the data’s use case. If data is static and is not likely to change, it can be loaded in viewDidLoad and cached. Whereas, if data changes regularly, use viewDidAppear to load it.
Like an interface in Java, the protocol defines a list of optional and required methods that a class can/must implement to adopt the protocol. Any class can define a protocol, and other classes can send protocol method-based messages to the class without knowing its type.
MVC or Model View Controller is a design pattern that defines how logic will be separated when the user interface is implemented. In iOS, UIView is the base class provided by Apple for all views, and UIViewController is provided to support the Controller, which listens to events in a View and updates it when data changes.
State transitions can be responded to state changes in an appropriate way by calling corresponding methods on the app’s delegate object.
For example:
* applicationDidBecomeActive( ) method: To prepare to run as the foreground app.
* applicationDidEnterBackground( ) method: To execute some code when the app is running in the background that may be suspended at any time.
* applicationWillEnterForeground( ) method: To execute some code when the app is moving out of the background.
* applicationWillTerminate( ) method: Called when the app is being terminated.
The process of selecting which implementation of a polymorphic operation to call at run time is called Dynamic dispatch. It is used when we need to invoke our methods like the object method.
synthesize generates getter and setter methods for your property.
We use dynamic for subclasses of NSManagedObject. @dynamic tells the compiler that getter and setters are implemented somewhere else.
synchronized guarantees that only one thread can be executing that code in the block at any given time.
Dynamic Dispatch is the process of selecting which implementation
of a polymorphic operation that’s a method or a function to call at run time. This means, that when we wanna invoke our methods like object method. but Swift does not default to dynamic dispatch.
Code coverage is a metric that helps us to measure the value of our unit tests.
Completion handlers are super convenient when our app is making an API call, and we need to do something when that task is done, like updating the UI to show the data from the API call. We’ll see completion handlers in Apple’s APIs like dataTaskWithRequest and they can be pretty handy in your own code.
Broke down its design process to prioritize usability in 4 steps:
* Think like the user, then design the UX.
* Remember that users are people, not demographics.
* When promoting an app, consider all the situations in which it could be useful.
* Keep working on the utility of the app even after launch.
The bounds of a UIView is the rectangle, expressed as a location (x,y) and size (width, height) relative to its own coordinate system (0,0).
The frame of a UIView is the rectangle, expressed as a location (x,y) and size (width, height) relative to the superview it is contained within.
Regular expressions are special string patterns that describe how to search through a string.
TVMLKit is the glue between TVML, JavaScript, and your native tvOS application.
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 onboard storage.
Functions let us group a series of statements together to perform some task. Once a function is created, it can be reused over and over in your code. If you find yourself repeating statements in your code, then a function may be the answer to avoid that repetition.
ARC (Automatic Reference Counting) is a compiler-level feature that defines the process of managing the lifetime of objects in objective-C.
It is used for building software codes to run on iOS for the iPad and iPhone. Cocoa Touch is written in the objective-C language and has a different set of graphical control elements to Cocoa.
Atomic:
Default behavior
Not fast
Make certain the process is completed entirely by CPU
Nonatomic:
Not default behavior
Faster
Not able to deal with multiple requests at the same time
The process of adding new operators and changing existing ones to do various things is known as operator overloading.
+, *, and / symbols are known as operators.
It is said when it is not launched or gets terminated by the system while running.
An app is said to be in an active state when it is accepting events and running in the foreground.