You are on page 1of 55

Your First iOS App

1
Xcode 8 with Swift 3

Xcode 8 Swift 3
2
Xcode 9 with Swift 4

Xcode 9 Swift 4
3
Xcode 10 with Swift 4.2

Xcode 10 Swift 4.2


4
Launchpad  Xcode

5
Xcode 9

6
Xcode Single View App

7
Swift Language

8
9
10
Main.storyboard (UI)

11
Main.storyboard (UI)

12
Main.storyboard (UI)
ViewController.swift (Code)

13
Main.storyboard (UI)
ViewController.swift (Code)

14
15
Label

16
Button

17
Text Field

18
Text Field

19
Text Field

20
Label

21
Label

22
23
Button

24
Button

25
Set the active scheme
iOS Simulator: iPhone

26
iOS Simulators: iPhone 7

27
Build and Run

28
iOS Simulator: iPhone 7 - iOS 10

29
Simulator: Quit Simulator

30
Main.storyboard (UI)
ViewController.swift (Code)

31
ViewController.swift (Code)

32
IBOutlet and IBAction
• IBOutlet
–Interface Builder Outlet
• IBAction
–Interface Builder Action

33
34
35
36
Hold on control
drag and drop button to Assistant Editor

37
38
39
btnHello

40
btnHello

IBAction
(Interface Builder Action)
41
Hold on control
drag and drop to Assistant Editor

42
txtYourName

43
txtYourName

IBOutlet
(Interface Builder Outlet)

44
Hold on control
drag and drop to Assistant Editor

45
myLabel

46
myLabel

IBOutlet
(Interface Builder Outlet)

47
48
@IBAction func btnHello()

49
@IBAction func btnHello()

50
@IBAction func btnHello()

51
Build and Run

52
53
54
55

You might also like