Introduction to iOS
Kristiina Rahkema
1
Introduction to iOS
Kristiina Rahkema
About me:
• PhD student
• Analysing iOS apps: Code quality, security
• Former iOS developer
• Interests: iOS development, security research
2
iOS vs Android
3
https://www.statista.com/statistics/272698/global-market-share-held-by-mobile-operating-systems-since-2009/
Why should we care about iOS?
iOS vs Android
4 https://gs.statcounter.com/os-market-share/mobile/north-america
https://www.statista.com/statistics/272698/global-market-share-held-by-mobile-operating-systems-since-2009/
Why should we care about iOS?
iOS vs Android
5 https://gs.statcounter.com/os-market-share/mobile/north-america
https://www.statista.com/statistics/272698/global-market-share-held-by-mobile-operating-systems-since-2009/
Why should we care about iOS?
• Revenue: $85 billion vs $48 billion
iOS vs Android
6 https://gs.statcounter.com/os-market-share/mobile/north-america
https://www.statista.com/statistics/272698/global-market-share-held-by-mobile-operating-systems-since-2009/
Why should we care about iOS?
• Revenue: $85 billion vs $48 billion
• Both platforms are important
General overview of iOS platform:
7
• Xcode
General overview of iOS platform:
8
• Xcode
• Mac, iPhone
iOS vs Android
9
• App Store vs (F-Droid, Google Play, direct download)
iOS vs Android
10
• App Store vs (F-Droid, Google Play, direct download)
• Apple developer program ($99/year vs 25$/once for Google)
iOS vs Android
11
• App Store vs (F-Droid, Google Play, direct download)
• Apple developer program ($99/year vs 25$/once for Google)
• iOS jailbreaking vs Android rooting
• Root access, alternative app stores
iOS vs Android
12
• App Store vs (F-Droid, Google Play, direct download)
• Apple developer program ($99/year vs 25$/once for Google)
• iOS jailbreaking vs Android rooting
• Root access, alternative app stores
• Apple's Human Interface Guidelines
iOS vs Android
13
• App Store vs (F-Droid, Google Play, direct download)
• Apple developer program ($99/year vs 25$/once for Google)
• iOS jailbreaking vs Android rooting
• Root access, alternative app stores
• Apple's Human Interface Guidelines
• Development language:
• Swift/Objective-C vs Kotlin/Java
Swift
14
https://docs.swift.org/swift-book/GuidedTour/GuidedTour.html
Swift
15
https://docs.swift.org/swift-book/GuidedTour/GuidedTour.html
Swift
16
• Online REPL:
• https://www.tutorialspoint.com/compile_swift_online.php
Swift
17
• Online REPL:
• https://www.tutorialspoint.com/compile_swift_online.php
• Short Swift demo
Creating an app
18
Creating an app
19
Creating an app
20
21
Creating an app
22
UIKit programmatically vs
Storyboard vs
Swift UI
23
Swift UI example
24
https://developer.apple.com/tutorials/swiftui/building-lists-and-navigation
Swift UI example
25
https://developer.apple.com/tutorials/swiftui/building-lists-and-navigation
Android:
Jetpack Compose
26
Example: ProtonMail for iOS (Repository used in lab)
Example: ProtonMail for iOS
27
Example: ProtonMail for iOS
28
Example: ProtonMail for iOS: https://github.com/ProtonMail/ios-mail
29
Architecture
30
Architecture: MVC
https://medium.com/ios-os-x-development/ios-architecture-patterns-ecba4c38de52 31
Architecture: MVC -> Massive view controller?
https://medium.com/ios-os-x-development/ios-architecture-patterns-ecba4c38de52 32
Architecture alternatives: MVP (passive)
https://medium.com/ios-os-x-development/ios-architecture-patterns-ecba4c38de52 33
Architecture alternatives: MVP (active)
https://medium.com/ios-os-x-development/ios-architecture-patterns-ecba4c38de52 34
Architecture alternatives: MVVM
https://medium.com/ios-os-x-development/ios-architecture-patterns-ecba4c38de52 35
Architecture alternatives: VIPER
https://medium.com/ios-os-x-development/ios-architecture-patterns-ecba4c38de52 36
Lifecycle
Android https://medium.com/@vipandey54/37
uiviewcontroller-lifecycle-7ca2d36f4f07 iOS
38
Lifecycle
https://medium.com/@neroxiao/ios-app-life-cycle-ec1b31cee9dc
Storage
39
Storage
40
Storage
41
Storage
42
• Offline
• iCloud sync
• Codable
Storage:
examples
43
44
Storage:
examples
45
Storage:
examples
Privacy
46
Privacy
47
Privacy
48
Privacy
49
Privacy
50
51
Third-party libraries
• CocoaPods
• Carthage
• Swift Package Manager
52
Swift Package Manager
• CocoaPods
• Carthage
• Swift Package Manager
53
Intents similar to Android
Declaring an AppIntent makes it available through:
• Share Extensions
• AppleScript
• Suggestions
• Lock Screen
• Shortcuts Widgets
• Voice (Siri)
• etc.
https://www.wwdcnotes.com/notes/wwdc22/10032/
54
URL schemes
Where to go from here?
55
• Apple documentation: https://developer.apple.com/documentation
• Kodeco (formerly raywenderlich.com) https://www.kodeco.com
• 100 days with swift https://www.hackingwithswift.com/100
56
Summary
57
Summary
58
Summary
59
Summary
Any questions?
Thank you for listening!
60