We all know the exclusivity posture that Apple has in relation to its products, and it does not change in relation to application development.
What we need to develop applications for iOS are:
- OS X 10.9.4 or higher;
- iOS SDK;
With it we have the code editor, graphical tool for editing the application interface, and several other interesting tools such as a tool for debugging code.
The iOS SDK extends Xcode to include tools, compilers, and frameworks that the developer need during an application development.
The iOS SDK contains all the features that developers need to install, run and test our native applications developed for a device that runs iOS.
The whole architecture of iOS is divided into layers, and each layer have different frameworks, as we can see in Figure 1.
Figure 1. Architecture of iOS.
We will detail each of the layers presented so that we can understand them.
This layer provides a range of frameworks that are used for the construction of our apps. Among them we can mention frameworks for looking, multi tasking, touch-based input, push notifications, among others. This subject is vast, so we will mention some key features of this layer:
- App Extensions: This feature is only available now by Apple and it allows us to create extensions of our applications that can be used within a user's work context. For example, our application should allow users to share their photos on a website. Using the app extensions the user, within the context of the album, can share a photo via the application extension without having to open it. Thus, we can create various interactions and ease of use for users, who are increasingly demanding. We have these areas known as "extensions points", that is, where the created extensions are executed. We will detail below each of these "extensions points":
- Share: content sharing through social networks, websites, among others;
- Action: Run a simple task with the content on display;
- Widget: access to publish content on the bar "Notification Center" or "Today Vision";
- Photo editing: allows photos or videos editions within the native iOS Photos app;
- Document provider: allows a place for document storage that can be accessed by other applications;
- Custom keyboard: allows the user to configure a different keyboard than the standard iOS keyboard; Each of these "extensions points" comes in an API to use. We know also that an extension is different from an application, although extensions for distribution should be created within an application that are known as "containing app."
- Handoff: This is an interesting feature available in OS X and iOS, as allows user to extend the use of the application between platforms. Through this feature the user can start an application functionality on a device and switch to another, continuing to use the same functionality that was started on another device. For example, a user is accessing any content on the web via Safari and switches to another device running iOS logged in with the same Apple ID. What happens is that the user will see the same content automatically on another iOS device, even in the same position of the device that started the feature. In summary the Handoff allows you to transfer user activity between two devices associated with the same Apple user ID. There are some applications, for example, Safari, Mail, Maps and others who do use this feature.
- Local Notifications: is a complement to Push Notifications, which in turn, is a feature that enables applications to generate local notifications. Applications that are running in the background can use local notifications as a way to draw the user's attention when considered important events occur. For example, the maps application that generates notifications to the user when you make a turn. In addition, it allows the scheduling of the event notifications for a future date, so the notifications are triggered even if the application that made the schedule is not in execution. The advantage is that local notifications are independent of application: once scheduled the layer system will manage the delivery of these notifications.
- AirDrop: This feature allows users to share different types of data, such as photos and documents with other iOS devices that are nearby.
- Multitasking: This is a feature that optimizes battery consumption of iOS devices, giving applications the time needed to perform critical tasks. When the user clicks the Home button, the application is sent to run in the background and there is no longer any task to be performed, it is placed in a state of freezing, i.e., is waiting in the memory to be called again.
- Auto Layout: through this feature you can build interfaces of dynamic and versatile users by defining rules that will define the layout of the screen elements, properly accounting changes for size, orientation and location. To work with auto layout we use entities, which are objects known as "constraints". Through the constraints we can define the rules for the layout of elements on the screen, for example, we can create a constraint that specifies the width of an element, or the horizontal distance between two elements.
This layer provides the technology to facilitate the implementation and the development of multimedia experiences for users, for example, resources to design rich interfaces, audio and video. It's considered one of the most important layers, because, according to the philosophy of Apple, the developer should worry about offering a good experience to his users.
Among the features of this layer, we have:
- Graphics Technologies: provides several features to create high-quality user interfaces. Among the features we can cite:
- UIKit Graphics: provides support for creating drawings and animations, as well as in providing an efficient way to work with the rendering of images - which is very important when it comes to mobile devices - and text-based content;
- Core Graphics: is a drawing native feature that provides support for creating 2D images;
- Core Animation: provides resources to perfect the animations that are created in applications, including UIKit Views that uses Core Animation as support in your animations;
- Core Image: provides powerful tools for creating filters for handling videos and still images;
- Photos Library: works with another framework, the PhotosUI. We can use it to access photos, videos and other user media files. Valley stand out that any application access to user data requires permission from the same;
- Audio Technologies: using this technology we can work with reproduction and high quality audio recording, and still make the iOS device send custom sounds as our need. This technology works with the device hardware, providing so a range of creative and useful possibilities. We will list below the frameworks that are part of this technology:
- Media Player Framework: through this we can access the user's iTunes library and play music;
- AV Foundation: this is an interface written in Objective-C for the reproduction management and audio and video recording;
- OpenAL: is a focused framework for the development of games as it is a standard in the software industry for high quality audio delivery;
- Core Audio: is a rich set of frameworks that allow us to work with recording and playback of audio and MIDI content;
- Video Technologies: This feature provides us ways to manage the contents of videos within the application, and also reproduce videos that are stored on the Internet. Let's emphasize that according to the device hardware, we can make video capture and incorporates it in the application. Below are some features of this technology:
- UIImagePickerController: This class is a UIKit View Controller that allows the user to select a media file, and also allows you to capture new content;
- AVKit: this framework uses existing objects in AV Foundation for us to manage video playback on the device;
- AV Foundation: This framework is also present in Audio Technologies. It is written in Objective-C interface for playback management and audio and video recording;
- Core Media: defines a low-level typing and interfaces to media manipulation. It's used when we need to have more precise control over the creation and playback of audio and video content;
- AirPlay: through this feature we can develop applications that can be integrated with Apple TV allowing us to do streamming of audio and/or video to any receiver/transmitter that make use of AirPlay, such as Apple TV as well as third parties. AirPlay is incorporated into various existing frameworks, thus any content that makes the use of these frameworks are automatically enabled for use by this technology.
Core Service Layer
This layer contains fundamental resources we use in application development. We can cite the two main frameworks of this layer, the Core Foundation and the Foundation. They define resources that almost all applications use. Let's take a look at some of the frameworks that make up this layer:
- CloudKit Framework: provides several interfaces for working with data transfer between our applications and the iCloud storage containers. In this way we can integrate our application to iCloud, for example;
- Core Framework Data: provides resources to work with storage and management of data structures in our applications. The structures we set in our code are created at runtime and are available to be manipulated at any time;
- Core Foundation Framework: provides a series of interfaces based on the C language for data management and services, such as data collections, strings management, stream manipulation, among other resources;
- Core Location Framework: This framework provides the means to work with location information, one way to obtain the user's device location is through the GPS device. This way we can create applications based on the user's location, for example, the application should provide the user with a list of bars and restaurants near it.
- Foundation Framework: give us code containers written in Objective-C for many of the features that are provided by the Core Foundation Framework;
Core OS Layer
This is a low-level layer which is widely used by the layers of upper levels, even if it is not used directly, it is somehow used by other frameworks with higher levels that we will use at some point. The direct use of this layer usually occurs when we need to do an explicit security negotiation or communication with external hardware, e.g., via Bluetooth communication. Let's break down some of the frameworks of this layer:
- Accelerate Framework: provides a variety of interfaces to work with digital signal processing, linear algebra and image processing calculations. Another feature we quote are the various mathematical functions that enable working with complex calculations;
- Bluetooth Core Framework: provides us ways to interact with external devices via bluetooth. For example, an application that communicates with a temperature gauge or a heart rate monitor;
- Local Authentication Framework: This framework provides the resources to integrate our applications with the Touch ID, digital identification feature - this feature is only available from the iPhone 5S model;
- Security Framework: This framework provides the various interfaces for managing certificates, public and private keys and access reliability policies. Among some features include:
- Support based encryption pseudorandomics numbers;
- Support for storage of certificates and encryption keys in a kind of keychain - secure repository for user data;
- Key sharing between applications, for example, a user must log in two applications whose login is the same, through this sharing feature we can identify the user already logged into an application and you do not need to login again in another application because the login has been accomplished. Of course, we must always be very careful when it comes to safety, but depending on the requirements, it can fit you well.
- System: this is the system level that encompasses the kernel environment, drivers, and low-level UNIX operating system interfaces. As the kernel is responsible for managing the virtual memory, threads, system files, network and communication processes. For security reasons, access to the kernel and drivers is restricted and limited to a group of system and application frameworks. IOS provides us a series of interfaces that allows us to access various features of the low operating system level through Libsystem library. Here are some of these resources:
- Input and output patterns;
- Memory allocation;
- Resources for computational mathematics;
Throughout this article we have a division of layers of iOS, and its frameworks. We can conclude that the architecture of iOS is organized in such a way that the resources we need to use for application development can be used through frameworks.
It is very important to know the platform architecture and their respective frameworks, as this will allow us to use more efficiently the resources that are available, and we can develop more and more interesting features.
Thank you for your attention and see you next time.
Official documentation on iOS
Information about the Cocoa Touch Layer
Information about the Media Layer
Information about the Core Service Layer
Information about the Core OS Layer