iOS software architecture consists of four distinct layers. Each
layer is associated with several frameworks. A framework is a package
consisting of a dynamic shared library along with header files
defining the application programming interfaces (API) to the library and other
resources such as helper applications. Frameworks can be used in an application
by simply linking them with the application project. iOS Technologies has two
Level of Layers, Lower-Level Layer and Higher-Level Layer,
These Levels are as follows:
- Cocoa Touch Layer
- Media Layer
- Core Services Layer
- Core OS Layer
Cocoa Touch Layer: this
Layer is placed on Higher-Level Layer, it contains key frameworks for building
iOS apps and these frameworks define the appearance of your app, provides the
basic app infrastructure and support for key technologies such as multitasking,
touch-based input, push notifications, and many high-level system services.
There are some Key Technologies that are available in this Layer:
App Extensions: you might supply an app
extension that helps users post content to your social sharing website. After
users install and enable this extension, they can choose it when they tap the
Share button in their current app. Your custom sharing extension provides the
code that accepts, validates, and posts the users content. The system lists the
extension in the sharing menu and instantiates it when the user chooses it.
iOS supports app extensions for the following areas, which are
known as extension points:
Share: Share content with social websites or other entities.
Action: Perform a simple task with the current
Widget: Provide a quick update or enable a brief
task in the Today view of
Photo editing: Perform edits to a
photo or video within the Photos app.
Document provider: Provide a document
storage location that can be accessed by other apps. Apps that use a document
picker view controller can open files managed by the Document Provider or move
files into the Document Provider.
Custom keyboard: Provide a custom
keyboard that the user can choose in place of the system keyboard for all apps
on the device.
Handoff: Handoff enables users to begin an activity
on one device, then switch to another device and resume the same activity on
the other device. For example, a user who is browsing a long article in Safari
moves to an iOS device that's signed into the same Apple ID, and the same
webpage automatically opens in Safari on iOS, with the same scroll position as
on the original device. Handoff makes this experience as seamless as possible.
Document Picker: The document picker
view controller grants users access to files outside your application’s
sandbox. It is a simple mechanism for sharing documents between apps. It also
enables more complex workflows, because users can edit a single document with
AirDrop: AirDrop lets users share photos, documents,
URLs, and other kinds of data with nearby devices. Support for sending files to
other iOS devices using AirDrop is built into the existing
TextKit: TextKit is a full-featured, high-level
set of classes for handling text and fine typography. Using TextKit, you can
lay out styled text into paragraphs, columns, and pages; you can flow text
around arbitrary regions such as graphics; and you can use it to manage
multiple fonts. If you were considering using Core Text to implement text
rendering, you should consider TextKit instead.
Multitasking: Battery life is an important consideration
for users of iOS devices and the multitasking model in iOS is designed to
maximize battery life while giving apps the time they need to do critical work.
When the user presses the Home button, the foreground app shifts to a
background execution context. If the app has no more work to do, it is
suspended from active execution and put into a "freeze-dried” state, where
it remains in memory but does not execute any code.
Auto Layout: Auto layout helps you build dynamic
interfaces with very little code. Using Auto Layout, you define rules for how
to lay out the elements in your user interface. These rules express a larger
class of relationships and are more intuitive to use than the springs and
struts model that was used previously.
Storyboards: Storyboards let you design your entire user
interface in one place so that you can see all of your views and view
controllers and understand how they work together. You can use a single
storyboard file to store all of your app’s view controllers and views, or you
can use multiple view storyboards to organize portions of your interface.
Gesture Recognizers: Gesture recognizers detect common types of
gestures, such as swipes and pinches in your app’s views. Because they use the
same heuristics as the system for detecting gestures, gesture recognizers offer
a consistent behavior for your apps.
Media Layer: this Layer is also placed on Higher-Level
Layer, it contains the graphics, audio, and video technologies you use to
implement multimedia experiences in your apps. The technologies in this layer
make it easy for you to build apps that look and sound great.
Graphics Technologies: High-quality
graphics are an important part of all apps and iOS provides numerous
technologies to help put your custom art and graphics onscreen. The iOS
graphics technologies offer a wide range of support, working seamlessly with
the UIKit view architecture to make it easy to deliver content.
Audio Technologies: The iOS audio
technologies work with the underlying hardware to provide a rich audio
experience for your users. This experience includes the ability to play and
record high-quality audio, to handle MIDI content, and to work with a device’s
Video Technologies: The iOS video
technologies provide support for managing static video content in your app or
playing back streaming content from the Internet.
AirPlay: AirPlay support is built into numerous
frameworks—UIKit framework, Media Player framework, AV Foundation framework,
and the Core Audio family of frameworks—so in most cases you do not need to do
anything special to support it. Any content you play using these frameworks is
automatically made eligible for AirPlay distribution. When the user chooses to
play your content using AirPlay, it is routed automatically by the system.
Core Services Layer: The Core Services
Layer provides access to the key systems services that are required by
applications. One of the main frameworks in this layer is the Core Foundation
framework, which provides capabilities such a string management, threading,
socket communication and managing data types such as arrays, URLs and even raw
bytes. The Core Foundation framework APIs are C- based.
However, the Foundations framework provides Objective-C wrappers
for the interfaces provided by the Core Foundation framework. This layer also
contains individual technologies to support features such as location, iCloud,
social media, and networking.
High-Level Features: some of the high-level features available
in the Core Services layer
Peer-to-Peer Services: The Multipeer
Connectivity framework provides peer-to-peer connectivity over Bluetooth. You
can use peer-to-peer connectivity to initiate communication sessions with
iCloud Storage: iCloud storage lets
your app write user documents and data to a central location. Users can then
access those items from all of their computers and iOS devices. Storing
documents in a user’s iCloud account also provides a layer of safety for users.
Even if a user loses a device, the documents on that device are not lost if
they are in iCloud storage:
There are two ways that apps can take advantage of iCloud
storage, each of which has a different intended usage:
o iCloud document storage: Use this feature to store user
documents and data in the user’s iCloud account.
o iCloud key-value data storage: Use this feature to share
small amounts of data among instances of your app.
o CloudKit storage: Use this feature when you want to
create publicly shared content or when you want to manage the transfer of data
yourself. Data Protection:
Data protection allows apps that
work with sensitive user data to take advantage of the built-in encryption
available on some devices. When your app designates a specific file as
protected, the system stores that file on disk in an encrypted format. While
the device is locked, the contents of the file are inaccessible to both your
app and to any potential intruders. However, when the device is unlocked by the
user, a decryption key is created to allow your app to access the file. Other
levels of data protection are also available for you to use.
Implementing data protection requires you to be considerate in
how you create and manage the data you want to protect. Apps must be designed
to secure the data at creation time and to be prepared for access changes when
the user locks and unlocks the device.
File-Sharing Support: File-sharing support
lets apps make user data files available in iTunes 9.1 and later. An app that
declares its support for file sharing makes the contents of its /Documents
directory available to the user. The user can then move files in and out of
this directory as needed from iTunes. This feature does not allow your app to
share files with other apps on the same device; that behavior requires the
pasteboard or a document interaction controller object.
Core OS Layer: this is the base layer
of iOS which deals with low-level functionalities related to network
configuration and communication, accessing the file system, memory allocation,
virtual memory management, threading and inter-processing communication.
The LibSystem library of iOS allows developers to access a
number of these functionalities directly.
However, for most developers it is much more convenient to
utilize frameworks and associated APIs available in the higher layers for their
One of the exceptions is the case where the application needs to
interact with external hardware such as Bluetooth Low-Energy devices and
accessories which are attached to an iOS device. In such case developer needs
to utilize the Core Bluetooth or the External Accessory framework, which are
part of the Core OS Layer.
Next, we will learn about Class cluster : iOS Concept : Class