Open menu with table of contents iOS Development Introduction
Logo of Stuttgart Media University for light theme Logo of Stuttgart Media University for dark theme
Mobile Application Development 2

iOS Development Introduction

Stuttgart Media University

1 Agenda

  • iOS Overview
    • System Architecture, Runtime Environment
  • Application Life Cycle
  • Development Tools

2 iOS Overview - Facts

  • Formerly known as iPhone OS, introduced on 29th July 2007 with the Apple iPhone
  • Derived from Mac OS X, based on Darwin a free, Unix like OS
  • Kernel type: Hybrid
  • Supported platforms: ARM
  • Size: approx. 2.3 GB
  • Current version: 17.4.1
  • Current iOS devices: iPhone, iPod Touch, iPad (derivate iPadOS), Apple TV (derivate tvOS), Apple Watch (derivate watchOS)

3 iOS Architecture

center 70%

4 Application Runtime Environment

  • Applications run in a UNIX based environment and have full support for threads, sockets, etc. but differences to Mac OS X exist, e.g.:
  • Virtual Memory
    • Virtual Memory is constrained to physical available memory (no paging to disk)
    • Read-only pages are released when more memory is needed
    • No Garbage Collector
  • Multitasking (iOS > 4.0)
    • Apps in background are suspended
    • Apps can ask system for background execution

5 Application Runtime Environment

  • Security features
    • Application sandbox
      • iOS Apps are restricted to a unique location in the file system
    • File protection (iOS > 4.0)
      • Allows to encrypt files and make them inaccessible when the device is locked
    • Keychain
      • similar to Mac OS X keychain, allows to store passwords
      • Stored outside the application sandbox

6 Application Structure

Each iOS app is composed of at least the following parts:

  • Datamodel (app dependent)
    • Class: e.g. UIDocument
  • Controller
    • Classes: UIApplication, UIViewController
    • Protocol: UIApplicationDelegate
  • View
    • Classes: UIWindow, UIView based classes

center 80%

Source: Apple

7 Application Life Cycle

  • Different application states
State Description
Not running The application has not been launched or was running but was terminated by the system
Inactive The application is running in the foreground but is currently not receiving events
Active The application is running in the foreground and is receiving events.
Background The application is in the background and executing code (only iOS > v.4)
Suspended The application is in the background but is not executing code (only iOS > v.4)

center 70%

Source: Apple

8 Application Life Cycle

  • Launching an application into the active state

center 40%

Source: Apple

9 Application Life Cycle

  • Handling events

center 50%

Source: Apple

10 Application Life Cycle

  • Handling application interruptions

center 50%

Source: Apple

11 Application Life Cycle

  • Moving an application to the background
  • If more time is needed the application can call beginBackgroundTaskWithExpirationHandler() within applicationDidEnterBackground()

center 40%

Source: Apple

12 Application Life Cycle

  • Resuming foreground execution

center 50%

Source: Apple

13 Application Life Cycle

  • iOS Memory Management example video by Fraser Speirs:

http://vimeo.com/34660348

14 Development Tools

  • Xcode: IDE including Debugger
    • IDE for Mac OS X and iOS
    • Sourcecode editor
    • Debugging in simulator and remote on device supported
    • Compiler: Apple LLVM Compiler
    • Current version: 13.0

center 80%

15 Development Tools

  • Simulator (not an emulator)
  • Simulating the iOS devices using iOS libraries on Mac OS X
  • Uses Intel code, simulates GPS, multitouch (pressing alt), shaking the device and orientation changes
  • Logs error messages to console

center 40%

16 Development Tools

  • Interface Builder: tool for creating GUIs

center 60%

17 Development Tools

  • Storyboards: Interface Builder feature since Xcode 4.2, before using XIBs
  • Allows to specify screens and the triggers and transitions between them

center 60%

18 Development Tools

  • Instruments: tracing and profiling tool

center 60%

Source: Apple

19 Recap Questions

  • iOS is based on which operation system?
  • What are the different states an iOS app can be in?
  • What is the purpose of the event queue?
  • What is the purpose of the event loop?
  • Can an iOS app run in the background and if yes, under which circumstances?
  • What is the difference concerning Memory Management between iOS and MacOS?