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

Xcode 1

This document provides instructions for creating a basic iOS app using Xcode and Swift. It demonstrates how to set up a single view app template, add interface elements like labels, buttons, and text fields using the storyboard, and connect these elements to code using outlets and actions. The instructions then guide connecting a button press to update a label's text, building and running the app in the iOS simulator to test it.

Uploaded by

Mael MD
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
154 views

Xcode 1

This document provides instructions for creating a basic iOS app using Xcode and Swift. It demonstrates how to set up a single view app template, add interface elements like labels, buttons, and text fields using the storyboard, and connect these elements to code using outlets and actions. The instructions then guide connecting a button press to update a label's text, building and running the app in the iOS simulator to test it.

Uploaded by

Mael MD
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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