Book description
Acquire and hone the skills to develop iOS apps for iPhone and iPad devices using the Xcode development environment, SwiftUI, and the Swift programming language
Key Features
- Learn to write object-oriented code using the Swift programming language
- Understand how to work with the SwiftUI app lifecycle
- Become comfortable developing apps using Xcode
Book Description
Do you want to create iOS apps with SwiftUI, Xcode 12, and Swift 5.3, and want to publish it on the app store? This book helps you achieve these skills with a step-by-step approach.
This course first walks you through the steps necessary to set up an iOS development environment together and introduces Swift Playgrounds to learn and experiment with Swift—specifically, the Swift 5.3 programming language. After establishing key concepts of SwiftUI and project architecture, this course provides a guided tour of Xcode in SwiftUI development mode.
The book also covers the creation of custom SwiftUI views and explains how these views are combined to create user interface layouts, including the use of stacks, frames, and forms. One of the more important skills you’ll learn is how to integrate SwiftUI views into existing UIKit-based projects and explain the integration of UIKit code into SwiftUI.
Finally, the book explains how to package up a completed app and upload it to the app store for publication. Along the way, the topics covered in the book are put into practice through detailed tutorials, the source code for which is also available for download.
By the end of this course, you will be able to build your own apps for iOS 14 using SwiftUI and publish it on the app store.
What you will learn
- Install and configure the Xcode integrated development environment
- Add navigation and lists to your apps
- Draw graphics and animate your user interfaces
- Recognize and respond to touches and gestures
- Integrate SiriKit into your iOS apps
- Integrate legacy UIKit iOS code into SwiftUI apps and vice versa
Who this book is for
This book is best suited for iOS developers who want to build their own apps for iOS 14 using SwiftUI.
This course assumes that you have an Apple Mac system and are ready to download the iOS 14 SDK while following along with the course.
Table of contents
- 1. Start Here
- 2. Joining the Apple Developer Program
- 3. Installing Xcode 12 and the iOS 14 SDK
- 4. An Introduction to Xcode 12 Playgrounds
- 5. Swift Data Types, Constants and Variables
-
6. Swift Operators and Expressions
- 6.1 Expression Syntax in Swift
- 6.2 The Basic Assignment Operator
- 6.3 Swift Arithmetic Operators
- 6.4 Compound Assignment Operators
- 6.5 Comparison Operators
- 6.6 Boolean Logical Operators
- 6.7 Range Operators
- 6.8 The Ternary Operator
- 6.9 Nil Coalescing Operator
- 6.10 Bitwise Operators
- 6.11 Compound Bitwise Operators
- 6.12 Summary
-
7. Swift Control Flow
- 7.1 Looping Control Flow
- 7.2 The Swift for-in Statement
- 7.3 The repeat ... while loop
- 7.4 Breaking from Loops
- 7.5 The continue Statement
- 7.6 Conditional Control Flow
- 7.7 Using the if Statement
- 7.8 Using if ... else … Statements
- 7.9 Using if ... else if ... Statements
- 7.10 The guard Statement
- 7.11 Summary
- 8. The Swift Switch Statement
-
9. Swift Functions, Methods and Closures
- 9.1 What is a Function?
- 9.2 What is a Method?
- 9.3 How to Declare a Swift Function
- 9.4 Implicit Returns from Single Expressions
- 9.5 Calling a Swift Function
- 9.6 Handling Return Values
- 9.7 Local and External Parameter Names
- 9.8 Declaring Default Function Parameters
- 9.9 Returning Multiple Results from a Function
- 9.10 Variable Numbers of Function Parameters
- 9.11 Parameters as Variables
- 9.12 Working with In-Out Parameters
- 9.13 Functions as Parameters
- 9.14 Closure Expressions
- 9.15 Shorthand Argument Names
- 9.16 Closures in Swift
- 9.17 Summary
-
10. The Basics of Swift Object-Oriented Programming
- 10.1 What is an Instance?
- 10.2 What is a Class?
- 10.3 Declaring a Swift Class
- 10.4 Adding Instance Properties to a Class
- 10.5 Defining Methods
- 10.6 Declaring and Initializing a Class Instance
- 10.7 Initializing and De-initializing a Class Instance
- 10.8 Calling Methods and Accessing Properties
- 10.9 Stored and Computed Properties
- 10.10 Lazy Stored Properties
- 10.11 Using self in Swift
- 10.12 Understanding Swift Protocols
- 10.13 Opaque Return Types
- 10.14 Summary
- 11. An Introduction to Swift Subclassing and Extensions
- 12. An Introduction to Swift Structures and Enumerations
- 13. An Introduction to Swift Property Wrappers
-
14. Working with Array and Dictionary Collections in Swift
- 14.1 Mutable and Immutable Collections
- 14.2 Swift Array Initialization
- 14.3 Working with Arrays in Swift
- 14.4 Random Items and Shuffling
- 14.5 Appending Items to an Array
- 14.6 Array Iteration
- 14.7 Creating Mixed Type Arrays
- 14.8 Swift Dictionary Collections
- 14.9 Swift Dictionary Initialization
- 14.10 Sequence-based Dictionary Initialization
- 14.11 Dictionary Item Count
- 14.12 Accessing and Updating Dictionary Items
- 14.13 Adding and Removing Dictionary Entries
- 14.14 Dictionary Iteration
- 14.15 Summary
- 15. Understanding Error Handling in Swift 5
- 16. An Overview of SwiftUI
-
17. Using Xcode in SwiftUI Mode
- 17.1 Starting Xcode 12
- 17.2 Creating a SwiftUI Project
- 17.3 Xcode in SwiftUI Mode
- 17.4 The Preview Canvas
- 17.5 Preview Pinning
- 17.6 The Preview Toolbar
- 17.7 Modifying the Design
- 17.8 Editor Context Menu
- 17.9 Previewing on Multiple Device Configurations
- 17.10 Running the App on a Simulator
- 17.11 Running the App on a Physical iOS Device
- 17.12 Managing Devices and Simulators
- 17.13 Enabling Network Testing
- 17.14 Dealing with Build Errors
- 17.15 Monitoring Application Performance
- 17.16 Exploring the User Interface Layout Hierarchy
- 17.17 Summary
- 18. SwiftUI Architecture
- 19. The Anatomy of a Basic SwiftUI Project
-
20. Creating Custom Views with SwiftUI
- 20.1 SwiftUI Views
- 20.2 Creating a Basic View
- 20.3 Adding Additional Views
- 20.4 Working with Subviews
- 20.5 Views as Properties
- 20.6 Modifying Views
- 20.7 Working with Text Styles
- 20.8 Modifier Ordering
- 20.9 Custom Modifiers
- 20.10 Basic Event Handling
- 20.11 Building Custom Container Views
- 20.12 Working with the Label View
- 20.13 Summary
- 21. SwiftUI Stacks and Frames
- 22. SwiftUI State Properties, Observable, State and Environment Objects
-
23. A SwiftUI Example Tutorial
- 23.1 Creating the Example Project
- 23.2 Reviewing the Project
- 23.3 Adding a VStack to the Layout
- 23.4 Adding a Slider View to the Stack
- 23.5 Adding a State Property
- 23.6 Adding Modifiers to the Text View
- 23.7 Adding Rotation and Animation
- 23.8 Adding a TextField to the Stack
- 23.9 Adding a Color Picker
- 23.10 Tidying the Layout
- 23.11 Summary
- 24. SwiftUI Lifecycle Event Modifiers
- 25. SwiftUI Observable and Environment Objects – A Tutorial
- 26. SwiftUI Data Persistence using AppStorage and SceneStorage
- 27. SwiftUI Stack Alignment and Alignment Guides
- 28. SwiftUI Lists and Navigation
-
29. A SwiftUI List and Navigation Tutorial
- 29.1 About the ListNavDemo Project
- 29.2 Creating the ListNavDemo Project
- 29.3 Preparing the Project
- 29.4 Adding the Car Structure
- 29.5 Loading the JSON Data
- 29.6 Adding the Data Store
- 29.7 Designing the Content View
- 29.8 Designing the Detail View
- 29.9 Adding Navigation to the List
- 29.10 Designing the Add Car View
- 29.11 Implementing Add and Edit Buttons
- 29.12 Adding the Edit Button Methods
- 29.13 Summary
- 30. An Overview of List, OutlineGroup and DisclosureGroup
- 31. A SwiftUI List, OutlineGroup and DisclosureGroup Tutorial
- 32. Building SwiftUI Grids with LazyVGrid and LazyHGrid
- 33. Building Tabbed and Paged Views in SwiftUI
- 34. Building Context Menus in SwiftUI
- 35. Basic SwiftUI Graphics Drawing
- 36. SwiftUI Animation and Transitions
- 37. Working with Gesture Recognizers in SwiftUI
- 38. Creating a Customized SwiftUI ProgressView
- 39. An Overview of SwiftUI DocumentGroup Scenes
- 40. A SwiftUI DocumentGroup Tutorial
- 41. An Introduction to SiriKit
- 42. A SwiftUI SiriKit Messaging Extension Tutorial
- 43. Customizing the SiriKit Intent User Interface
-
44. A SwiftUI SiriKit NSUserActivity Tutorial
- 44.1 About the SiriKit Photo Search Project
- 44.2 Creating the SiriPhoto Project
- 44.3 Enabling the Siri Entitlement
- 44.4 Seeking Siri Authorization
- 44.5 Adding an Image Asset
- 44.6 Adding the Intents Extension to the Project
- 44.7 Reviewing the Default Intents Extension
- 44.8 Modifying the Supported Intents
- 44.9 Modifying the IntentHandler Implementation
- 44.10 Implementing the Resolve Methods
- 44.11 Implementing the Confirmation Method
- 44.12 Handling the Intent
- 44.13 Testing the App
- 44.14 Adding a Data Class to SiriPhoto
- 44.15 Designing the Content View
- 44.16 Adding Supported Activity Types to SiriPhoto
- 44.17 Handling the NSUserActivity Object
- 44.18 Testing the Completed App
- 44.19 Summary
- 45. An Overview of Siri Shortcut App Integration
-
46. A SwiftUI Siri Shortcut Tutorial
- 46.1 About the Example App
- 46.2 App Groups and UserDefaults
- 46.3 Preparing the Project
- 46.4 Running the App
- 46.5 Enabling Siri Support
- 46.6 Seeking Siri Authorization
- 46.7 Adding the Intents Extension
- 46.8 Adding the SiriKit Intent Definition File
- 46.9 Adding the Intent to the App Group
- 46.10 Configuring the SiriKit Intent Definition File
- 46.11 Adding Intent Parameters
- 46.12 Declaring Shortcut Combinations
- 46.13 Configuring the Intent Response
- 46.14 Configuring Target Membership
- 46.15 Modifying the Intent Handler Code
- 46.16 Adding the Confirm Method
- 46.17 Donating Shortcuts to Siri
- 46.18 Testing the Shortcuts
- 46.19 Designing the Intent UI
- 46.20 Summary
-
47. Building Widgets with SwiftUI and WidgetKit
- 47.1 An Overview of Widgets
- 47.2 The Widget Extension
- 47.3 Widget Configuration Types
- 47.4 Widget Entry View
- 47.5 Widget Timeline Entries
- 47.6 Widget Timeline
- 47.7 Widget Provider
- 47.8 Reload Policy
- 47.9 Relevance
- 47.10 Forcing a Timeline Reload
- 47.11 Widget Sizes
- 47.12 Widget Placeholder
- 47.13 Summary
-
48. A SwiftUI WidgetKit Tutorial
- 48.1 About the WidgetDemo Project
- 48.2 Creating the WidgetDemo Project
- 48.3 Building the App
- 48.4 Adding the Widget Extension
- 48.5 Adding the Widget Data
- 48.6 Creating Sample Timelines
- 48.7 Adding Image and Color Assets
- 48.8 Designing the Widget View
- 48.9 Modifying the Widget Provider
- 48.10 Configuring the Placeholder View
- 48.11 Previewing the Widget
- 48.12 Summary
- 49. Supporting WidgetKit Size Families
- 50. A SwiftUI WidgetKit Deep Link Tutorial
- 51. Adding Configuration Options to a WidgetKit Widget
- 52. Integrating UIViews with SwiftUI
- 53. Integrating UIViewControllers with SwiftUI
- 54. Integrating SwiftUI with UIKit
-
55. Preparing and Submitting an iOS 14 Application to the App Store
- 55.1 Verifying the iOS Distribution Certificate
- 55.2 Adding App Icons
- 55.3 Assign the Project to a Team
- 55.4 Archiving the Application for Distribution
- 55.5 Configuring the Application in App Store Connect
- 55.6 Validating and Submitting the Application
- 55.7 Configuring and Submitting the App for Review
- Index
Product information
- Title: SwiftUI Essentials – iOS 14 Edition
- Author(s):
- Release date: May 2021
- Publisher(s): Packt Publishing
- ISBN: 9781801813228
You might also like
video
SwiftUI - The Complete iOS 17 Reference Library of Code
This course transforms app development learning with a definitive compilation of SwiftUI techniques, frameworks, and best …
book
iOS 16 Programming for Beginners - Seventh Edition
Take your next step in iOS app development and work with Xcode 14 and iOS 16. …
book
Head First Android Development, 3rd Edition
What will you learn from this book? If you have an idea for a killer Android …
video
A Beginner's Guide to Creating iPhone Apps for iOS 15 Using Swift UI
If you are looking for a course that is fun, for complete beginners, and gets straight …