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

  • Application Structure
    • Datamodel
    • Controller
    • View
  • Application Life Cycle

2 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 70%

Source: Apple

3 Application Life Cycle - Application States

  • 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 60%

Source: Apple

4 Application Life Cycle - Launching an application

  • Launching an application into the active state

center 40%

Source: Apple

5 Application Life Cycle - Handling events

  • Handling events

center 40%

Source: Apple

6 Application Life Cycle - Handling interruptions

  • Handling application interruptions

center 40%

Source: Apple

7 Application Life Cycle - Background execution

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

center 40%

Source: Apple

8 Application Life Cycle - Resuming foreground execution

  • Resuming foreground execution

center 40%

Source: Apple

9 Application Life Cycle - Memory Management

  • iOS Memory Management example video by Fraser Speirs:

Video iOS Memory Management

10 Recap Questions

  • 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?