IOS App Components - University of Virginia

[Pages:25]iOS App Components

CS 4720 ? Mobile Application Development

CS 4720

iOS Architecture

2

CS 4720

Building Blocks

? UIApplication

? The main entry point for your app ? Each app has exactly one instance of this class ? Provides the main interface back to the OS ? Handles all incoming info from the OS (such as

touch event, memory warnings, incoming phone call, etc.) ? Passes these messages off to...

3

CS 4720

Building Blocks

? UIApplicationDelegate

? Manages the running of your app ? Handles "major" events, like app swtiching, app

initialization, etc.

4

CS 4720

AppDelegate.swift

import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

5

CS 4720

AppDelegate.swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { return true

}

6

CS 4720

Other Components

? UIDocument: allows for internal app documents and data stores

? ViewController: manages all views (scenes) for the app

? UIWindow: the one window of the iOS device (only have more if external display)

? View Objects: all the widgets in a scene

7

CS 4720

The Main App Loop

8

CS 4720

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

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download