0% found this document useful (0 votes)
14 views

Unit 4

Uploaded by

anishasl052
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Unit 4

Uploaded by

anishasl052
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Case Study – Android

UNIT 4 CASE STUDY - iOS


Structure

4.0 Introduction
4.1 Objectives
4.2 Features of iOS
4.3 Evolution of iOS
4.4 Architecture of iOS
4.5 iOS Kernel Architecture
4.6 Processes and Threads Management
4.6.1 Threading Packages
4.6.2 Threads Alternatives
4.7 Memory Management
4.7.1 Application Memory Management
4.7.2 Virtual Memory Management
4.7.3 Page List in Kernel
4.7.4 Page Fault
4.8 File System in iOS
4.8.1 iOS Directories
4.8.2 iCloud Container
4.8.3 Identification of File Type
4.8.4 Security of File System
4.9 Summary
4.10 Solutions / Answers
4.11 Further Readings

4.0 INTRODUCTION
iPhone operating system (iOS) is a mobile operating system developed by Apple Inc.
used for apple handheld devices. It is used in devices like- iPhone, iPad and iPod. It is
the second most widely used mobile operating system. It supports features like direct
manipulation and can respond to various types of user gestures. It is proprietary and
closed source and derived from macOS. Software development kit (SDK) is provided
to create applications. It includes interfaces for developing, running and testing
applications. Apps can be written using system frameworks and Objective-C
programming language.

Initial three versions were introduced with the name iPhone OS. From fourth version,
they renamed it to iOS. With each new version, new features and apps were added.
iOS 13 is latest version which was released in 2019. Its major feature is dark mode
and new Map application with street view capability. It also enhanced its previous
apps and features like-Siri, Heath map and others. iOS 14 is about to release in
2020. 63
Case Studies
4.1 OBJECTIVES
After going through this unit, you should be able to:
 Understand the basic functions of iOS Operating System
 Know the history of iOS operating system
 Understand the process management in iOS and can compare with other OS
 Understand the memory management approaches in iOS
 Understand the File management in iOS
 Understand the security features in iOS

4.2 FEATURES OF IOS


iOS is the operating system for iPhone, iPad and other Apple mobile devices. Based
on Mac OS, the operating system which runs Apple’s line of Mac desktop and laptop
computers, Apple iOS is designed for easy, seamless networking between Apple
products. iOS support extremely good features and some of the common features
are:
 Multitasking – it allows multiple tasks to be executed concurrently. This
feature allows various applications to run in background like notifications,
VoIP, audio, Bluetooth access, app updates and may more.
 SpringBoard – It is used for managing home screen.
 Gesture recognition
 Wifi, Bluetooth and support for VPN
 Access to Apple App store
 Support for integrated search – it allows files to be search simultaneously
 Safari browser
 Front and read camera with videos capturing facility
 Siri – it is an intelligent personal assistant feature which can take voice
queries and can givevoice responses and recommendations, used for setting
reminders etc.
 Game center – it is multiplayer gaming network available online.
 Compatible with iCloud – iCloud is cloud service provided byApple.
 Push email service – Apples’s email server allows mails to be delivered
as they arrive.
 Accelerometer, gyroscope, and magnetometer – these are sensor
interfaces used to listen various events.
 Apple pay – it is payment technology which can store credit card details to
pay for services.
64
 Services like Maps, contacts, web pages, messages, location Case Study – iOS

 Various security features – face ID, pass code, 2 factor authentication.


 HomePod – it can identify family members by voice and can handoff calls ,
music etc on other devices.
 HomeKit – it is home automation controlling system.
 CarPlay – this allows interacting with iOS during drive. Also allows access
tom phone apps.
Apple keeps making iOS 14 and iPadOS 14 even better by adding valuable new
capabilities and features. Most recently, Apple released iOS 14.4, adding a new
workout to Fitness Plus for Apple Watch owners. It also added a new Unity watch
face in February to celebrate Black History Month. The update also included a series
of security fixes for vulnerabilities that were actively being exploited.
iOS 14.4 follows the addition of Apple ProRaw photos to the iPhone 12 Pro and 12
Pro Max. Those new features join an already impressive list of capabilities that Apple
brought to its mobile devices with the release of iOS 14 in September. iOS 14.5 is
currently available in beta and is shaping up to be a significant update for iPhone
owners.

4.3 EVOLUTION OF IOS


iOS was first introduced with iPhone in Jan 2007 and released in June 2007. At first
introduction Steve Jobs claimed it to be running OS X and running desktop class
application but during release introduced it with the name “iPhone OS”. Initially, there
was no support for third party applications. In March 2008,Apple announced software
development kit for iPhone. In July 2008, iOS app store opened with 500 applications
which increased to 3000 in Sept 2008 and after successive growth through the years
increased to 2.2 million in 2017. It is also estimated to reach 5 million by 2020. iOS
has seen a lot of changes since its inception. Following are the important milestones in
iOS:
 iOS was first introduced with iPhone in jan 2007 and released in june 2007.
 Apple’s iOS first SDK was released on March 6, 2008.
 The initial release was named iPhone OS which was later changed to iOS on
June 7, 2010.
 iPhone OS 1 was released on March 6, 2008, and is the first version of the
popular operating system. The support for iPhone OS 1 ended after two
years, i.e., 2010.
 iPhone OS 2, as the name suggest, is the 2nd big release for the iOS. The
release was done in conjunction with iPhone 3G, and anyone with the previous
version can easily upgrade to the latest version. Also, this version introduced
the App store, which becomes the hub for installing new apps. New SDK
was also released for developers with support ending in 2011.
 The third big release was Apple iOS 3. It came into existence in June 2009
with support ending in late 2012. New features such as copy, paste, etc. are
added to the OS. 65
Case Studies The next version is iOS 4 and is released on June 21, 2010. Clearly, this is
one of the big releases for iOS as it dropped old device support instead of
supporting the latest devices with multitasking features.
 iOS 5 was released on June 6, 2001. It brought support for iPad Touch (3rd
generation) and iPad (1st generation).
 iOS 6 went live on September 19, 2012, for the 4th generationApple devices.
 iOS 7 was released for public on September 18, 2013. It supported two new
phones by Apple, the Apple iPhone 5S and iPhone 5C.
 Just like the old release, iOS 8 released for public on September 9, 2014, with
support for their best phone devices, the iPhone 6 and iPhone 6 Plus. They
dropped support for older devices.
 iOS 9 was made public on September 16, 2015. Apple changed how they
support legacy hardware and iOS 9 became the first Apple OS that supported 22
devices.
 iOS 10 was announced on June 13, 2016 at WWDC(Worldwide Developers
Conference event and was released to public in September, 2016 along with
iPhone 7 and iPhone 7 plus.
 iOS 11 was made public on September, 2017 along with iPhoen 8 and iPhone 8 Plus.
It has dropped 32-bit applications making iOS 11 as a 64-bit OS that only runs 64-
bit apps.
 iOS 12 was made public on September 2018 along with iPhone XS, iPhone XS
Max, iPhone XR.
 Apple announced iOS 13 and made public on September, 2019. The principal
features include Dark Mode and Memoji support. The NFC(Near Field
Communication) framework supports reading several types of contactless
smartcards and tags.
 Apple released iOS 14 and iPadOS 14 on 9th July 2020. All devices that
support iOS 13 also support iOS 14. Some new features includes widgets that be
now be placed directly on the home-screen, along with theApp library which
automatically categorizes apps into one page, Picture in Picture, Car- key
technology to unlock and start a car with NFC. It also allow the user to have
incoming calls shown in banners rather than taking up the whole screen. As on date
(March, 2021) 14.1 is available in beta 3 version.

4.4 ARCHITECTURE OF IOS


iOS architecture is written in Objective-C language and comprised of four
layers(layered architecture). It consists of a stack of four layers – Core OS, Core
services, media layer, and Cocoa Touch as shown in Figure 1. Apps installed on
system communicate with the iOS which in turn communicates with the hardware.
Bottom level layers in the iOS stack are responsible for basic services while the
upper layers are responsible for providing interface and graphics designing.
Apple provides system interfaces called Frameworks which is a package that stores
66 dynamic shared libraries. It contains various resources like – header files, supported
ap
pps, images. Each
E layer of iOS
i contains different set oof frameworkks that can be used Case Study – iOS
to developers to
t design apps.

Fig 1. iOS Layyered Architectture

Leet us learn moore about the layered


l archiitecture show
wn in the abovve figure.

4..4.1 Coree OS
It is the lowest layer
l in the iO
OS architecturre hence respoonsible for prroviding basicc low
levvel features. The
T framewoorks present inn this layer aree:
 Securiity services frramework
 Autheentication fraamework
 Bluetoooth framewo
ork
 Externnal accessory
y framework
 Accelerate framew
work

4..4.2 Coree Services


It is the layer at the top of corre Os layer. Th
he various fraameworks avaailable at this layer
aree:
 Core data
d Framew
work - It is ussed for manaaging Modell View Contrroller
(MVCC) app.
 Core Foundation
F framework
fr - Itt gives interfacces used to maanage data,
servicees and featurres.
 Addreess book fram
mework - Useed for accessiing user’s con
ntacts databaase.
 Cloudd Kit framewoork -Allows movement
m off data betweenn apps and iCloud.
 Core Location
L fram
mework - Useed to give locaation and heaading informaation
to appps.
 Core Motion Fraamework - Used U to acccess motion based data and
acceleerometer baseed informationn.
 Healthhkit framework - Used to handle
h health oriented info
ormation of usser
 Homeekit frameworrk - Used to connect
c and control
c user’ss home devicees.
 Sociall framework - Used to hanndle social meedia accountss of user.
 StoreK
Kit frameworrk - Used to provides
p In -App Purchasse. 67
Case Studies 4.4.3 Media Layer
This is the third layer from the bottom. It is used for providing audio, video and
graphics features.
Audio Frameworks
 Media Player Framework - It is used to handle user’s playlist.
 AV Foundation - It is used for recording and playback of audio and video.
 OpenAL- It is standard technology for providing audio. Video Frameworks
 AV Kit - This interface is used for video presentation.
 AV Foundation - It gives advanced video recording and playback capability.
 Core Media - It is used to describe low level data types and interfaces for
operating media.
Graphics Frameworks
 Core Graphics framework - It is used for custom 2D vector and image based
rendering.
 Core Animation - It is used for adding animation in apps.
 Core Images - It is used for gives for controlling video and images
 UIKit Graphics - It is used for designing images and animating content of
views.
 OpenGl ES and GLKit - It is used for managing2D and 3D rendering.

4.4.4 Cocoa touch layer


It is the top most layer in iOS architecture. It is used for providing interactive interfaces
to user. The various frameworks present in this layer are:
 UIKit Framework – It is used for designing graphical, event-driven apps.
 EventKit framework - It is used for providing system interfaces for viewing
and altering calendar related events
 GameKit Framework - It allows users to share game related information
online.
 MapKit Framework - It allows maps to be included in user interface.
 PushKitFramework- It provides support for VoIP apps.
 Twitter Framework - It allows access to Twitter service.

4.5 IOS KERNEL ARCHITECTURE


iOS kernel is XNU kernel of Darwin. Initially it was used only for MacOS and later
introduced as free and open source part of Darwin operating system. It is a hybrid
68 kernel which supports both monolithic and microkernel.
Case S
Study – iOS

Fig
F 2: XNU keernel Architectture
(Source: deveeloper.apple.coom)

Th he foundatioon layer of Darwin


D and OS
O X is commposed of sevveral architeectural
coomponents, ass shown in Fiigure 2. Thesse componennts form the kernel
k environnment.
Inn OS X, howeever, the kerneel environmeent contains much
m more thaan the Mach kernel
itsself. The OS X kernel enviironment inclludes the Macch kernel, BS SD, the I/O K
Kit, file
syystems, and networking co omponents. These
T are ofteen referred to
o collectively as the
keernel. Each of these compponents is desscribed brieflly in the follo
owing sectionns. For
fuurther details,, refer to the specific
s com
mponent chaptters or to the reference maaterial
lissted in the biblliography.
Beecause OS X contains threee basic compponents (Macch, BSD, andd the I/O Kit), there
arre also frequeently as manyy as three APIs for certainn key operatioons. In generral, the
AP PI chosen shoould match thhe part of the kernel
k wheree it is being ussed, which in turn is
dictated by whaat your code is attempting tot do. The rem mainder of thiis chapter desscribes
Mach,
M BSD, an nd the I/O Kiit and outlinees the functioonality that is provided byy those
coomponents.
Mach
M
Mach
M managees processorr resources such
s as CPU U usage and memory, haandles
sccheduling, prrovides mem mory protection, and prrovides a messaging-cen
m ntered
inffrastructure tot the rest of
o the operaating-system layers. The Mach compponent
prrovides untypped interproceess communiication (IPC),, remote proccedure calls (RRPC),
sccheduler sup pport for symmmetric mulltiprocessing (SMP), sup pport for reaal-time
seervices, virtuaal memory suupport, suppoort for pagers and modularr architecture.
BS
SD
Ab bove the Macch layer, the BSD
B layer prrovides “OS ppersonality” APIs and serrvices.
Thhe BSD layerr is based on the
t BSD kern nel, primarily FreeBSD. Th he BSD compponent
prrovides file sy
ystems, networrking (except for the hardw
ware device lev
vel), UNIX seecurity
model,
m syscall support, the BSD processs model, inclluding proceess IDs and siignals,
FrreeBSD kerneelAPIs, manyy of the POSIIX APIs, kernnel support for pthreads (P POSIX
thrreads).
Neetworking
OS X networkking takes addvantage of BSD’s
B advannced networkking capabilitties to
prrovide suppoort for modernn features, suuch as Netwoork Address Translation (NAT)
(
an
nd firewalls. The
T networkinng componennt provides 4.4BSD TCP//IP stack and ssocket
APIs, support for both IP and
a DDP (ApppleTalk trannsport), multiihoming, rouuting,
69
Case Studies multicast support, server tuning, packet filtering, Mac OS Classic support (through
filters).
File Systems
OS X provides support for numerous types of file systems, including HFS, HFS+,
UFS, NFS, ISO 9660, and others. The default file-system type is HFS+; OS X boots
(and “roots”) from HFS+, UFS, ISO, NFS, and UDF. Advanced features of OS X
file systems include an enhanced Virtual File System (VFS) design. VFS provides for
a layered architecture (file systems are stackable). The file system component provides
UTF-8 (Unicode) support and increased performance over previous versions of Mac
OS.
I/O Toolkit
The I/O Kit component provides true plug and play, dynamic device management,
dynamic (on-demand) loading of drivers, power management for desktop systems as
well as portables and multiprocessor capabilities.

4.6 PROCESSES AND THREADS MANAGEMENT


Every process in an application is created using one or more threads.Athread represents
single path of execution. Execution of a process starts with a single thread and can later
spawn multiple threads, where each thread performs a specific task.
All threads of a single process have same access rights and also shares same address
space (virtual memory). They can also communicate with each other and other
processes. Every thread has its own stack of execution and scheduled for execution
by kernel separately.IOS has the capability to execute multiple programs parallel but
most of the execution is done in background and does not require continuous
processing. The application that runs in foreground keeps the processor and other
resources busy.

4.6.1 Threading Packages


Applications may require creation of threads. IOS supports thread management and
synchronization along with other new technologies. The technologies used to manage
thread in iOS can be POSIX threads or Cocoa threads.
POSIX threads are based on C language. This must be used when application needs
to be designed for multiple platforms. Here threads are managed using pthread library.
Communication between threads can be done using ports, shared memory or
conditions. For Cocoa applications, threads are created using NSThread class. It
allows detached thread to be created. Detached thread is the one in which system
automatically reclaims thread’s resources when it terminates.

4.6.2 Threads Alternatives


Threads are lowlevel doing concurrencyand managingsynchronization becomesdifficult
for application development. Also the use of thread adds processor and memory
overheads. iOS henceoffersalternatives to thread programming. Execution of concurrent
tasks or processes on iOS is managed by asynchronous designing approach like
traditional thread approach. Applications should only define specific tasks instead of
creating threads as threads are low level and should leave it to system. Threads when
70
managed by system, gives scalability to applications. The various techniques provided Case Study – iOS
by iOS to manage tasks asynchronously are:
 Grand Central Dispatch (GCD)
In this approach user only defines the task to be done and add it to the
appropriate dispatch queue. GCD then creates threads as needed and
schedules them. Since in this approach thread management and execution
is done by system, it is more efficient than traditional threads approach.
 Operation Queues
They are similar to dispatch queue and are object-C objects. User defines
the task to execute and add it to operation queue. Scheduling and execution
is then done by operation queue.
Dispatch queues: Dispatch queue are used for execution of customized tasks. It
executes the task serially or concurrently in first-in first-out order. Serial dispatcher
waits for the task to complete before de-queuing, whereas concurrent dispatcher does
not wait for the tasks to finish before starting new tasks.
Operation Queues: In operation queues the order of execution of task is dependent
upon many factors. One such factor is the dependence of one task on the completion
of another task. User when defining a task should also configure dependency.
The various advantages of using dispatch and operation queues in place of threads
offer various advantages:
1. No need to store thread stack hence reduces memory requirements
2. User need not to configure and manage threads.
3. User need not to schedule threads.
4. It is easy to write code as compared to threads.

4.7 MEMORYMANAGEMENT
For effective and efficient utilization of memory, memory management is required by
the iOS. Resource needs to be free up when they are not required. In iOS memory
used by applications is managed by maintaining the life cycle of objects and freeing
them when not required. To identify that an object is no more required; its object graph
is created. The group of objects that are related to each other forms object graph. In
this, objects can be related by the direct reference or indirect reference.

4.7.1 Application Memory Management


Applications memory management can be done by Object - C by two methods:
i. Manual Retain Release – In this method user can themselves manage
memory by keeping track of objects created by them. This is
implemented using Reference Count Model. (for versions till iOS-5)
ii. Automatic Reference Counting – In this feature, provided by compiler, system
uses Reference counting model by calling methods for user at compile time.
(for new versions) 71
Case Studies

Fig
g3: Difference between
b Autom matic and Man nual Reference Counting
(Source: devveloper.apple.ccom)

Memory
M management usinng Reference counting is based b on Ownnership of object. An
object
o can be owned by one or many owners.o Thee object contiinues to existt till the
tiime it has atleeast one owneer. The objectt is destroyed automaticallyy at runtime iff has no
owner.
o Hencee, ownership is the ability of causing obbject to be destroyed.
a.
a Referencce Count Model
Memory
M is maanaged by maaintaining lifefe cycle of an object. Whenn the objects are not
needed,
n it shoould be de-allocated. Whhen an object is created or o copied, itss retain
count
c is set to 1.
1 This retainn count can inccreasewith tim
me if ownership
p interest is exxpressed
by
b other objeccts. The retainn count can alsoa be decrem mented if objjects relinquish their
in
nterest of owwnership. The object will be maintainedd in memory tiill it’s retain countc is
not
n zero. The object will bee deallocatedd once it’s retaain count reaches zero.

Fig
F 4: Reference Counting Model
M (Source: developer.applle.com)

b.
b Automattic Reference Counting
Automatic
A refference countting is a comppiler provideed feature thatt manages meemory
automatically
a of
o Object-C oobjects. Auto omatic referennce counting is
i an ownersship
72 syystem which provides connvention for management
m and transferr of ownershiip. It
the object’s lifetime requirements and user need not to remember about retain and Case Study – iOS
releases. It allows object to be pointed by two types of references- strong and week.
An object which is strongly referenced will be preserved and never deleted. The objects
having back reference is called weak reference and can be de-allocated (destroyed).
When no strong reference to objects is left, the object automatically becomes nil.
Hence weak reference does not increase life time of objects. This model also imposes
some restricts to prevent memory faults or issues.

4.7.2 Virtual Memory Management


Virtual memory overcomes the limitation of physical memory. For each process a
logical address space is created by dividing the memory into pages. Apage table is
maintained by Memory management units to map logical address to physical address.
Logical address is provided to each process but if application wants to access a page
with no physical address, page fault will occur. Virtual memory systemis then responsible
for invoking a special programcalled page fault handler. The pagefault handler suspends
the currently executing process, identifies free memory location and load the required
page fromthe disk. The corresponding page table entry is then updated and can be used
by returning control to the suspended process. This process of loading the page from
disk is called Paging. There is no backing store in iOS hence pages cannot be moved
out from primary memory ( page write) hence, if no free space is available in primary
memory than read only pages can be removed from memory which can be later loaded.
Page size in older versions of iOS is 4KB. While the newer version A9 supports
16KB pages.
Efficient use of memory is important for high performance of system. Reducing the
amount of memory usage decreases memory footprint of applications and also reduces
processor consumption. Afully integrated virtual memory is included with IOS which
is always on. For 32- bit system it can provide upto 4 GB addressable space.
Data present on the disk (code pages) which is read only, can be removed from the
primary memory and can later be loaded from the disk when needed, whereas, the
iOS does not remove the writable data from memory. If the free memory reduces
below a certain threshold, the running applications are asked to free up memory to
make room for new applications or data voluntarily.

4.7.3 Page List in Kernel


Kernel maintains three lists of physical memory pages:
i. Active list - this list contains pages which are recently accessed
ii. Inactive list - this list contains pages which are not recently accessed but still
present in physical memory.
iii. Free list - this list contains pages which are not currently allocated and is
available for use by processes.
The pages that are not accessed are moved from active to inactive list by kernel. Also
when the free memory reduces below a threshold, the pages that at unmodified and
inactive are flushed by kernel and running applications are asked to free up memory by
sending themlow memory notification.Applications uponreceiving notification remove
strong references to as many objects as possible.
73
Case Studies 4
4.7.4 Page Fault
Itt is the process of loadingg the page intoo primary mem mory when needed
n by a process.
p
This
T process is i required as a result of paage fault. Thee two types off fault that cann occur
are:
a
i. Soft fault - when the desired page p is not m
mapped to thhe address space of
proceess but it is prresent in physsical memory..
ii. Hardd fault - when the desired page
p is not preesent in the ph
hysical memoory.
Whenever
W paage fault occuurs, kernel fiinds the VM M object for accessed
a regiion and
checks
c the resident list of VM
V object. Iff the required ppage is foundd in resident liist, then
soft fault is gennerated otherw
wise hard fauult is generatedd. For handlinng soft fault, physical
p
memory
m of paage is mappedd to the virtuaal memory annd the page is marked as acctive by
kernel.
k For haandling hardd fault, pagerr of VM objeect finds the page p from diisk and
updates
u its maap entry. The ppage after loaading in primaary memory is i marked as active.
a

4.8
4 FILE
E MANAG
GEMEN
NT SYSTE
EM
Storage
S of datta, files, applications, opeerating system
m files is mannaged by file system.
s
The
T default fiile system useed in iOS is APFS
A for verrsions after iO
OS 10.3. Befo
fore this
HFS+
H was deffault file systtem. In iOS user cannot acccess file systtem directly but
b they
can
c access it using
u applicatiions.

4.8.1
4 iOS Directoriies
Applications
A c interact with
can w file systeem only its saandbox directtory. When thhe apps
are
a installed, various
v contaainer directorries are creatted in its sanddbox directoryy. Here
every
e containner is created for a specificc role. There aare two main n containers ––bundle
container
c and data containeer. Data contaainer is furtheer divided into o subdirectoriies used
too organize appp’s data. Inn addition to theses contaainers, apps can c also requuest for
additional
a conntainers exampple iCloud coontainer.

F
Fig5: Sandbox directory of iOOSApp
74 (Source: devveloper.apple.com)
Files outside these containers are generally restricted for use by applications. Use of Case Study – iOS
public system interfaces like contacts and music is exception to this rule.System
framework in this case uses helper apps to perform file operations by modifying or
reading from appropriate data storage locations.
Some of the commonly used directories in iOS sandbox are –
(i) Appname.app
This directory is created during app’s installation. It contains the app’s
executable data and resources. User should not write to this directory because
app may not launch due to change in signature. However, user can get read
only access to app’s bundle data.
(ii) Documents/
Data generated by user is stored in this directory. Files present in this directory
can be accessed by user using file sharing. This directory is also backed up by
iCloud and iTune.
(iii) Documents/Inbox
It is a subdirectory within Documents which is required by apps to open files
asked by outside entities. Apps can read and delete data from this directory
but cannot modify and create new files. Generally email attachments related
to apps are placed in this directory by mail program. This directory is also
backed up by iCloud and iTune.
(iv) Library/
This subdirectory is used to store data which is not required to be exposed to
user. It contains applications support, preferences and cache subdirectories
for iOS apps. Custom subdirectories can also be created by user but should
not be used for user data.This directory is placed in data bundle. Except
cache all the contents of this directory are also backed up.
(v) tmp/
This directory is used to store temporary file i.e. files that are not needed to
persist. These file must be deleted by the apps when they are not needed.
When apps arenot running, systemmaydelete thesesfiles. Datain this directory
is not backed up.
For proper organization of files, additional subdirectories can be created within
Documents, tmp and Library by iOS apps.

4.8.2 iCloud Container


iCloud service allows user to store their documents, photos, files, etc. to be stored in
cloud. Users when require can download these from their devices or share with other
users. iOS allows users data be automatically backed up in cloud through this service.
This feature is available in iOS 7 onwards.iCloud container is used to store files for
apps that use iCloud. Files and folders can be created by apps in the same way as
local file folders are created. Files and their attributes are copied to iCloud. Primary
iCloud container of apps stores native files. Within each container two subdirectories –
documents and data is present. Files present within document subdirectory are visible 75
Case Studies to user as separate document which can be individually deleted. Whereas files not
within document subdirectory is displayed as single entity in iCloud user interface called
data.

4.8.3 Identification of File Type


To identify the type of file, two techniques are used in iOS-
(i) UTIs - Uniform Type Identifier: UTIs is a string that identifies class entitities
uniquely. For all types of data and service it provides consistent identifiers. Not
only files but they can also represent folders or directories in a flexible manner.
They are used for identifying types of pasteboard. Some of the examples are:
 Public.jpeg - it represents a public type UTI identifying jpeg image data.
 com.apple.bundle - it represents anApple type identifying bundle directory.
 com.apple.application-bundle - it represents anApple type identifying bundled
app.
(ii) Filename extension : It is a character string following filename and a period (.).
Each extension represents a specific type of file. For example filename with .png
represents an image file. Also period is a valid character for filename, hence only
the string after last period is considered as extension to identify type.

4.8.4 Security of File System


(a) Sandbox environment
Applications during installation are automatically placed in a sandbox environment
in iOS. Sandbox does not allows apps to write data into locations to which user
should not write to. Every sandbox is created with few containers to which user
can write. One app cannot write to containers of other apps or most directories
outside their sandbox. Hence security of apps and data is maintained by restricting
the access.
(b) File Access Control
File access control in iOS is maintained by two techniques – ACL& BSD. System
assigns ACL and BSD permission to files created by apps.
i. Access Control List
a. Access control list is a list of control details which gives complete
information of what operations can or cannot be done to a directory or
file and by which users. Hence it allows different level of access writes to
different user.
ii. BSD
a. In BSD instead of giving access writes to individual users, it allows access
to be given on the basis of class of users. There exist three classes of
users – owner of data or file, group of user, all other users.
(c) Encryption
iOS allows files on disk to be encrypted. Files that are needed to be encrypted
76 can be designated by apps. When a device containing encrypted data is unlocked
by user, a decryption key is generated by system to enable access to file. Whereas, Case Study – iOS
when user locks the device, to prevent unauthorized access, the decryption key is
destroyed by the system.


Check Your Progress 1
1) Describe the important features of iOS 14.4 version.
........................................................................................................................
........................................................................................................................
........................................................................................................................
........................................................................................................................

2) Describe the features of watchOS 7.3.


........................................................................................................................
........................................................................................................................
........................................................................................................................
........................................................................................................................

4.9 SUMMARY
In this unit we had studied iOS operating system. iOS is a mobile operating system
developed byApple Inc for iPhone.Adescription of howprocess management, memory
management, file management, security in iOS is discussed in this unit. Along with
various functions of the iOS operating system, its evolution, architecture, and other
features were described.
In this course we had studied Operating Systems in general and 4 case studies.

4.10 SOLUTIONS / ANSWERS


Check Your Progress 1
1. Apple has released iOS 14.4 for compatible iPhone and iPod touch models. The
new iOS update brings an updated Camera app that carries support for smaller
QR codes. The latest software also introduces the option to classify Bluetooth
devices in Settings and includes a few bug fixes. There are also patches for three
vulnerabilities that might have been actively exploited.Apple iPad users have also
received iPadOS 14.4 with a similar list of changes that is available for the iPhone
users. Separately, Apple has released the HomePod software version 14.4 that
brings the anticipated ultra-wideband (UWB) handoff feature specifically to the
HomePod mini. The company has also rolled out watchOS 7.3 with the Apple
Watch Unity watch face and tvOS 14.4 with security fixes and general stability
improvements.
The iOS 14.4 and iPadOS 14.4 updates bring a list of improvements to the
compatible iPhone, iPod touch, and iPad models. One of those improvements is
smaller QR codes support for the Camera app. This will enhance the existing QR
77
Case Studies code recognition functionality of the default app. The latest software updates also
include the option to classify Bluetooth device type in Settings to let users identify
whether headphones or the built-in speaker will be used for audio notifications.
2. In January 2021, Apple has released watchOS 7.3 that brings the Unity watch
face. The update also brings Time to Walk for Apple Fitness+ subscribers and
expands the ECG app for the Apple Watch Series 4 and later to Japan, Mayotte,
Philippines, and Thailand. The eligible Apple Watch users in Japan, Mayotte,
Philippines, Taiwan, and Thailand will also get irregular heart rhythmnotifications
through the latest watchOS update. Furthermore, watchOS 7.3 fixes the issue
that made the Control Centre and Notification Centre unresponsive when Zoom
is enabled. The watchOS 7.3 update also patches the vulnerability tracked under
CVE-2021-1782 that could be exploited by a bad actor.

4.11 FURTHER READINGS


1. John Ray, iOS 9 Application Development in 24 Hours, Sams Teach Yourself,
2019.
2. Jesse Feiler, iOS App Development for Dummies, Wiley, 2014
3. Matt Neuburg, iOS 13 Programming Fundamentals with Swift, 2019.
4. Rajiv Ramnath, Beginnning iOS Programming for Dummies, Wiley, 2014.
5. https://developer.apple.com/

78

You might also like