This book aims to teach the skills necessary to create iOS apps using the iOS 16 SDK, UIKit, Xcode 14, and the Swift programming language. Beginning with the basics, this book outlines the steps necessary to set up an iOS development environment. Next, an introduction to the architecture of iOS 16 and programming in Swift 5.7 is provided, followed by an in-depth look at the design of iOS apps and user interfaces. More advanced topics such as file handling, database management, graphics drawing, and animation are also covered, as are touch screen handling, gesture recognition, multitasking, location management, local notifications, camera access, and video playback support. Other features include Auto Layout, local map search, user interface animation using UIKit dynamics, Siri integration, iMessage app development, and biometric authentication. Additional features of iOS development using Xcode are also covered, including Swift playgrounds, universal user interface design using size classes, app extensions, Interface Builder Live Views, embedded frameworks, collection and stack layouts, CloudKit data storage, and the document browser. Other features of iOS 16 and Xcode 14 are also covered in detail, including iOS machine learning features. The aim of this book, therefore, is to teach you the skills necessary to build your own apps for iOS 16. Assuming you are ready to download the iOS 16 SDK and Xcode 14, have a Mac, and some ideas for some apps to develop, you are ready to get started. 1. Start Here 1.1 Source Code Download 1.2 Feedback 1.3 Errata 2. Joining the Apple Developer Program 2.1 Downloading Xcode 14 and the iOS 16 SDK 2.2 Apple Developer Program 2.3 When to Enroll in the Apple Developer Program? 2.4 Enrolling in the Apple Developer Program 2.5 Summary 3. Installing Xcode 14 and the iOS 16 SDK 3.1 Identifying Your macOS Version 3.2 Installing Xcode 14 and the iOS 16 SDK 3.3 Starting Xcode 3.4 Adding Your Apple ID to the Xcode Preferences 3.5 Developer and Distribution Signing Identities 4. A Guided Tour of Xcode 14 4.1 Starting Xcode 14 4.2 Creating the iOS App User Interface 4.3 Changing Component Properties 4.4 Adding Objects to the User Interface 4.5 Building and Running an iOS App in Xcode 4.6 Running the App on a Physical iOS Device 4.7 Managing Devices and Simulators 4.8 Enabling Network Testing 4.9 Dealing with Build Errors 4.10 Monitoring Application Performance 4.11 Exploring the User Interface Layout Hierarchy 4.12 Summary 5. An Introduction to Xcode 14 Playgrounds 5.1 What is a Playground? 5.2 Creating a New Playground 5.3 A Swift Playground Example 5.4 Viewing Results 5.5 Adding Rich Text Comments 5.6 Working with Playground Pages 5.7 Working with UIKit in Playgrounds 5.8 Adding Resources to a Playground 5.9 Working with Enhanced Live Views 5.10 When to Use Playgrounds 5.11 Summary 6. Swift Data Types, Constants and Variables 6.1 Using a Swift Playground 6.2 Swift Data Types 6.2.1 Integer Data Types 6.2.2 Floating Point Data Types 6.2.3 Bool Data Type 6.2.4 Character Data Type 6.2.5 String Data Type 6.2.6 Special Characters/Escape Sequences 6.3 Swift Variables 6.4 Swift Constants 6.5 Declaring Constants and Variables 6.6 Type Annotations and Type Inference 6.7 The Swift Tuple 6.8 The Swift Optional Type 6.9 Type Casting and Type Checking 6.10 Summary 7. Swift Operators and Expressions 7.1 Expression Syntax in Swift 7.2 The Basic Assignment Operator 7.3 Swift Arithmetic Operators 7.4 Compound Assignment Operators 7.5 Comparison Operators 7.6 Boolean Logical Operators 7.7 Range Operators 7.8 The Ternary Operator 7.9 Nil Coalescing Operator 7.10 Bitwise Operators 7.10.1 Bitwise NOT 7.10.2 Bitwise AND 7.10.3 Bitwise OR 7.10.4 Bitwise XOR 7.10.5 Bitwise Left Shift 7.10.6 Bitwise Right Shift 7.11 Compound Bitwise Operators 7.12 Summary 8. Swift Control Flow 8.1 Looping Control Flow 8.2 The Swift for-in Statement 8.2.1 The while Loop 8.3 The repeat ... while loop 8.4 Breaking from Loops 8.5 The continue Statement 8.6 Conditional Control Flow 8.7 Using the if Statement 8.8 Using if ... else ... Statements 8.9 Using if ... else if ... Statements 8.10 The guard Statement 8.11 Summary 9. The Swift Switch Statement 9.1 Why Use a switch Statement? 9.2 Using the switch Statement Syntax 9.3 A Swift switch Statement Example 9.4 Combining case Statements 9.5 Range Matching in a switch Statement 9.6 Using the where statement 9.7 Fallthrough 9.8 Summary 10. Swift Functions, Methods and Closures 10.1 What is a Function? 10.2 What is a Method? 10.3 How to Declare a Swift Function 10.4 Implicit Returns from Single Expressions 10.5 Calling a Swift Function 10.6 Handling Return Values 10.7 Local and External Parameter Names 10.8 Declaring Default Function Parameters 10.9 Returning Multiple Results from a Function 10.10 Variable Numbers of Function Parameters 10.11 Parameters as Variables 10.12 Working with In-Out Parameters 10.13 Functions as Parameters 10.14 Closure Expressions 10.15 Shorthand Argument Names 10.16 Closures in Swift 10.17 Summary 11. The Basics of Swift Object-Oriented Programming 11.1 What is an Instance? 11.2 What is a Class? 11.3 Declaring a Swift Class 11.4 Adding Instance Properties to a Class 11.5 Defining Methods 11.6 Declaring and Initializing a Class Instance 11.7 Initializing and De-initializing a Class Instance 11.8 Calling Methods and Accessing Properties 11.9 Stored and Computed Properties 11.10 Lazy Stored Properties 11.11 Using self in Swift 11.12 Understanding Swift Protocols 11.13 Opaque Return Types 11.14 Summary 12. An Introduction to Swift Subclassing and Extensions 12.1 Inheritance, Classes and Subclasses 12.2 A Swift Inheritance Example 12.3 Extending the Functionality of a Subclass 12.4 Overriding Inherited Methods 12.5 Initializing the Subclass 12.6 Using the SavingsAccount Class 12.7 Swift Class Extensions 12.8 Summary 13. Working with Array and Dictionary Collections in Swift 13.1 Mutable and Immutable Collections 13.2 Swift Array Initialization 13.3 Working with Arrays in Swift 13.3.1 Array Item Count 13.3.2 Accessing Array Items 13.3.3 Random Items and Shuffling 13.3.4 Appending Items to an Array 13.3.5 Inserting and Deleting Array Items 13.3.6 Array Iteration 13.4 Creating Mixed Type Arrays 13.5 Swift Dictionary Collections 13.6 Swift Dictionary Initialization 13.7 Sequence-based Dictionary Initialization 13.8 Dictionary Item Count 13.9 Accessing and Updating Dictionary Items 13.10 Adding and Removing Dictionary Entries 13.11 Dictionary Iteration 13.12 Summary 14. Understanding Error Handling in Swift 5 14.1 Understanding Error Handling 14.2 Declaring Error Types 14.3 Throwing an Error 14.4 Calling Throwing Methods and Functions 14.5 Accessing the Error Object 14.6 Disabling Error Catching 14.7 Using the defer Statement 14.8 Summary 15. The iOS 16 App and Development Architecture 15.1 An Overview of the iOS 16 Operating System Architecture 15.2 Model View Controller (MVC) 15.3 The Target-Action pattern, IBOutlets, and IBActions 15.4 Subclassing 15.5 Delegation 15.6 Summary 16. Creating an Interactive iOS 16 App 16.1 Creating the New Project 16.2 Creating the User Interface 16.3 Building and Running the Sample App 16.4 Adding Actions and Outlets 16.5 Building and Running the Finished App 16.6 Hiding the Keyboard 16.7 Summary 17. Understanding iOS 16 Views, Windows, and the View Hierarchy 17.1 An Overview of Views and the UIKit Class Hierarchy 17.2 The UIWindow Class 17.3 The View Hierarchy 17.4 Viewing Hierarchy Ancestors in Interface Builder 17.5 View Types 17.5.1 The Window 17.5.2 Container Views 17.5.3 Controls 17.5.4 Display Views 17.5.5 Text and WebKit Views 17.5.6 Navigation Views and Tab Bars 17.5.7 Alert Views 17.6 Summary 18. An Introduction to Auto Layout in iOS 16 18.1 An Overview of Auto Layout 18.2 Alignment Rects 18.3 Intrinsic Content Size 18.4 Content Hugging and Compression Resistance Priorities 18.5 Safe Area Layout Guide 18.6 Three Ways to Create Constraints 18.7 Constraints in More Detail 18.8 Summary 19. Working with iOS 16 Auto Layout Constraints in Interface Builder 19.1 An Example of Auto Layout in Action 19.2 Working with Constraints 19.3 The Auto Layout Features of Interface Builder 19.3.1 Suggested Constraints 19.3.2 Visual Cues 19.3.3 Highlighting Constraint Problems 19.3.4 Viewing, Editing, and Deleting Constraints 19.4 Creating New Constraints in Interface Builder 19.5 Adding Aspect Ratio Constraints 19.6 Resolving Auto Layout Problems 19.7 Summary 20. Implementing iOS 16 Auto Layout Constraints in Code 20.1 Creating Constraints Using NSLayoutConstraint 20.2 Adding a Constraint to a View 20.3 Turning off Auto Resizing Translation 20.4 Creating Constraints Using NSLayoutAnchor 20.5 An Example App 20.6 Creating the Views 20.7 Creating and Adding the Constraints 20.8 Using Layout Anchors 20.9 Removing Constraints 20.10 Summary 21. Implementing Cross-Hierarchy Auto Layout Constraints in iOS 16 21.1 The Example App 21.2 Establishing Outlets 21.3 Writing the Code to Remove the Old Constraint 21.4 Adding the Cross Hierarchy Constraint 21.5 Testing the App 21.6 Summary 22. Understanding the iOS 16 Auto Layout Visual Format Language 22.1 Introducing the Visual Format Language 22.2 Visual Format Language Examples 22.3 Using the constraints(withVisualFormat:) Method 22.4 Summary 23. Using Trait Variations to Design Adaptive iOS 16 User Interfaces 23.1 Understanding Traits and Size Classes 23.2 Size Classes in Interface Builder 23.3 Enabling Trait Variations 23.4 Setting “Any” Defaults 23.5 Working with Trait Variations in Interface Builder 23.6 Attributes Inspector Trait Variations 23.7 Using Constraint Variations 23.8 An Adaptive User Interface Tutorial 23.9 Designing the Initial Layout 23.10 Adding Universal Image Assets 23.11 Increasing Font Size for iPad Devices 23.12 Adding Width Constraint Variations 23.13 Testing the Adaptivity 23.14 Summary 24. Using Storyboards in Xcode 14 24.1 Creating the Storyboard Example Project 24.2 Accessing the Storyboard 24.3 Adding Scenes to the Storyboard 24.4 Configuring Storyboard Segues 24.5 Configuring Storyboard Transitions 24.6 Associating a View Controller with a Scene 24.7 Passing Data Between Scenes 24.8 Unwinding Storyboard Segues 24.9 Triggering a Storyboard Segue Programmatically 24.10 Summary 25. Organizing Scenes over Multiple Storyboard Files 25.1 Organizing Scenes into Multiple Storyboards 25.2 Establishing a Connection between Different Storyboards 25.3 Summary 26. Using Xcode 14 Storyboards to Create an iOS 16 Tab Bar App 26.1 An Overview of the Tab Bar 26.2 Understanding View Controllers in a Multiview App 26.3 Setting up the Tab Bar Example App 26.4 Reviewing the Project Files 26.5 Adding the View Controllers for the Content Views 26.6 Adding the Tab Bar Controller to the Storyboard 26.7 Designing the View Controller User interfaces 26.8 Configuring the Tab Bar Items 26.9 Building and Running the App 26.10 Summary 27. An Overview of iOS 16 Table Views and Xcode 14 Storyboards 27.1 An Overview of the Table View 27.2 Static vs. Dynamic Table Views 27.3 The Table View Delegate and dataSource 27.4 Table View Styles 27.5 Self-Sizing Table Cells 27.6 Dynamic Type 27.7 Table View Cell Styles 27.8 Table View Cell Reuse 27.9 Table View Swipe Actions 27.10 Summary 28. Using Xcode 14 Storyboards to Build Dynamic TableViews 28.1 Creating the Example Project 28.2 Adding the TableView Controller to the Storyboard 28.3 Creating the UITableViewController and UITableViewCell Subclasses 28.4 Declaring the Cell Reuse Identifier 28.5 Designing a Storyboard UITableView Prototype Cell 28.6 Modifying the AttractionTableViewCell Class 28.7 Creating the Table View Datasource 28.8 Downloading and Adding the Image Files 28.9 Compiling and Running the App 28.10 Handling TableView Swipe Gestures 28.11 Summary 29. Implementing iOS 16 TableView Navigation using Storyboards 29.1 Understanding the Navigation Controller 29.2 Adding the New Scene to the Storyboard 29.3 Adding a Navigation Controller 29.4 Establishing the Storyboard Segue 29.5 Modifying the AttractionDetailViewController Class 29.6 Using prepare(for segue:) to Pass Data between Storyboard Scenes 29.7 Testing the App 29.8 Customizing the Navigation Title Size 29.9 Summary 30. Integrating Search using the iOS UISearchController 30.1 Introducing the UISearchController Class 30.2 Adding a Search Controller to the TableViewStory Project 30.3 Implementing the updateSearchResults Method 30.4 Reporting the Number of Table Rows 30.5 Modifying the cellForRowAt Method 30.6 Modifying the Trailing Swipe Delegate Method 30.7 Modifying the Detail Segue 30.8 Handling the Search Cancel Button 30.9 Testing the Search Controller 30.10 Summary 31. Working with the iOS 16 Stack View Class 31.1 Introducing the UIStackView Class 31.2 Understanding Subviews and Arranged Subviews 31.3 StackView Configuration Options 31.3.1 axis 31.3.2 distribution 31.3.3 spacing 31.3.4 alignment 31.3.5 baseLineRelativeArrangement 31.3.6 layoutMarginsRelativeArrangement 31.4 Creating a Stack View in Code 31.5 Adding Subviews to an Existing Stack View 31.6 Hiding and Removing Subviews 31.7 Summary 32. An iOS 16 Stack View Tutorial 32.1 About the Stack View Example App 32.2 Creating the First Stack View 32.3 Creating the Banner Stack View 32.4 Adding the Switch Stack Views 32.5 Creating the Top-Level Stack View 32.6 Adding the Button Stack View 32.7 Adding the Final Subviews to the Top Level Stack View 32.8 Dynamically Adding and Removing Subviews 32.9 Summary 33. A Guide to iPad Multitasking 33.1 Using iPad Multitasking 33.2 Picture-In-Picture Multitasking 33.3 Multitasking and Size Classes 33.4 Handling Multitasking in Code 33.4.1 willTransition(to newcollection: with coordinator:) 33.4.2 viewWillTransition(to size: with coordinator:) 33.4.3 traitCollectionDidChange(_:) 33.5 Lifecycle Method Calls 33.6 Opting Out of Multitasking 33.7 Summary 34. An iPadOS Multitasking Example 34.1 Creating the Multitasking Example Project 34.2 Adding the Image Files 34.3 Designing the Regular Width Size Class Layout 34.4 Designing the Compact Width Size Class 34.5 Testing the Project in a Multitasking Environment 34.6 Summary 35. An Overview of Swift Structured Concurrency 35.1 An Overview of Threads 35.2 The Application Main Thread 35.3 Completion Handlers 35.4 Structured Concurrency 35.5 Preparing the Project 35.6 Non-Concurrent Code 35.7 Introducing async/await Concurrency 35.8 Asynchronous Calls from Synchronous Functions 35.9 The await Keyword 35.10 Using async-let Bindings 35.11 Handling Errors 35.12 Understanding Tasks 35.13 Unstructured Concurrency 35.14 Detached Tasks 35.15 Task Management 35.16 Working with Task Groups 35.17 Avoiding Data Races 35.18 The for-await Loop 35.19 Asynchronous Properties 35.20 Summary 36. Working with Directories in Swift on iOS 16 36.1 The Application Documents Directory 36.2 The FileManager, FileHandle, and Data Classes 36.3 Understanding Pathnames in Swift 36.4 Obtaining a Reference to the Default FileManager Object 36.5 Identifying the Current Working Directory 36.6 Identifying the Documents Directory 36.7 Identifying the Temporary Directory 36.8 Changing Directory 36.9 Creating a New Directory 36.10 Deleting a Directory 36.11 Listing the Contents of a Directory 36.12 Getting the Attributes of a File or Directory 36.13 Summary 37. Working with Files in Swift on iOS 16 37.1 Obtaining a FileManager Instance Reference 37.2 Checking for the Existence of a File 37.3 Comparing the Contents of Two Files 37.4 Checking if a File is Readable/Writable/Executable/Deletable 37.5 Moving/Renaming a File 37.6 Copying a File 37.7 Removing a File 37.8 Creating a Symbolic Link 37.9 Reading and Writing Files with FileManager 37.10 Working with Files using the FileHandle Class 37.11 Creating a FileHandle Object 37.12 FileHandle File Offsets and Seeking 37.13 Reading Data from a File 37.14 Writing Data to a File 37.15 Truncating a File 37.16 Summary 38. iOS 16 Directory Handling and File I/O in Swift – A Worked Example 38.1 The Example App 38.2 Setting up the App Project 38.3 Designing the User Interface 38.4 Checking the Data File on App Startup 38.5 Implementing the Action Method 38.6 Building and Running the Example 38.7 Summary 39. Preparing an iOS 16 App to use iCloud Storage 39.1 iCloud Data Storage Services 39.2 Preparing an App to Use iCloud Storage 39.3 Enabling iCloud Support for an iOS 16 App 39.4 Reviewing the iCloud Entitlements File 39.5 Accessing Multiple Ubiquity Containers 39.6 Ubiquity Container URLs 39.7 Summary 40. Managing Files using the iOS 16 UIDocument Class 40.1 An Overview of the UIDocument Class 40.2 Subclassing the UIDocument Class 40.3 Conflict Resolution and Document States 40.4 The UIDocument Example App 40.5 Creating a UIDocument Subclass 40.6 Designing the User Interface 40.7 Implementing the App Data Structure 40.8 Implementing the contents(forType:) Method 40.9 Implementing the load(fromContents:) Method 40.10 Loading the Document at App Launch 40.11 Saving Content to the Document 40.12 Testing the App 40.13 Summary 41. Using iCloud Storage in an iOS 16 App 41.1 iCloud Usage Guidelines 41.2 Preparing the iCloudStore App for iCloud Access 41.3 Enabling iCloud Capabilities and Services 41.4 Configuring the View Controller 41.5 Implementing the loadFile Method 41.6 Implementing the metadataQueryDidFinishGathering Method 41.7 Implementing the saveDocument Method 41.8 Enabling iCloud Document and Data Storage 41.9 Running the iCloud App 41.10 Making a Local File Ubiquitous 41.11 Summary 42. Using iCloud Drive Storage in an iOS 16 App 42.1 Preparing an App to use iCloud Drive Storage 42.2 Making Changes to the NSUbiquitousContainers Key 42.3 Creating the iCloud Drive Example Project 42.4 Modifying the Info.plist File 42.5 Designing the User Interface 42.6 Accessing the Ubiquitous Container 42.7 Saving the File to iCloud Drive 42.8 Testing the App 42.9 Summary 43. An Overview of the iOS 16 Document Browser View Controller 43.1 An Overview of the Document Browser View Controller 43.2 The Anatomy of a Document-Based App 43.3 Document Browser Project Settings 43.4 The Document Browser Delegate Methods 43.4.1 didRequestDocumentCreationWithHandler 43.4.2 didImportDocumentAt 43.4.3 didPickDocumentURLs 43.4.4 failedToImportDocumentAt 43.5 Customizing the Document Browser 43.6 Adding Browser Actions 43.7 Summary 44. An iOS 16 Document Browser Tutorial 44.1 Creating the DocumentBrowser Project 44.2 Declaring the Supported File Types 44.3 Completing the didRequestDocumentCreationWithHandler Method 44.4 Finishing the UIDocument Subclass 44.5 Modifying the Document View Controller 44.6 Testing the Document Browser App 44.7 Summary 45. Synchronizing iOS 16 Key-Value Data using iCloud 45.1 An Overview of iCloud Key-Value Data Storage 45.2 Sharing Data Between Apps 45.3 Data Storage Restrictions 45.4 Conflict Resolution 45.5 Receiving Notification of Key-Value Changes 45.6 An iCloud Key-Value Data Storage Example 45.7 Enabling the App for iCloud Key-Value Data Storage 45.8 Designing the User Interface 45.9 Implementing the View Controller 45.10 Modifying the viewDidLoad Method 45.11 Implementing the Notification Method 45.12 Implementing the saveData Method 45.13 Testing the App 45.14 Summary 46. iOS 16 Database Implementation using SQLite 46.1 What is SQLite? 46.2 Structured Query Language (SQL) 46.3 Trying SQLite on macOS 46.4 Preparing an iOS App Project for SQLite Integration 46.5 SQLite, Swift, and Wrappers 46.6 Key FMDB Classes 46.7 Creating and Opening a Database 46.8 Creating a Database Table 46.9 Extracting Data from a Database Table 46.10 Closing an SQLite Database 46.11 Summary 47. An Example SQLite-based iOS 16 App using Swift and FMDB 47.1 About the Example SQLite App 47.2 Creating and Preparing the SQLite App Project 47.3 Checking Out the FMDB Source Code 47.4 Designing the User Interface 47.5 Creating the Database and Table 47.6 Implementing the Code to Save Data to the SQLite Database 47.7 Implementing Code to Extract Data from the SQLite Database 47.8 Building and Running the App 47.9 Summary 48. Working with iOS 16 Databases using Core Data 48.1 The Core Data Stack 48.2 Persistent Container 48.3 Managed Objects 48.4 Managed Object Context 48.5 Managed Object Model 48.6 Persistent Store Coordinator 48.7 Persistent Object Store 48.8 Defining an Entity Description 48.9 Initializing the Persistent Container 48.10 Obtaining the Managed Object Context 48.11 Getting an Entity Description 48.12 Setting the Attributes of a Managed Object 48.13 Saving a Managed Object 48.14 Fetching Managed Objects 48.15 Retrieving Managed Objects based on Criteria 48.16 Accessing the Data in a Retrieved Managed Object 48.17 Summary 49. An iOS 16 Core Data Tutorial 49.1 The Core Data Example App 49.2 Creating a Core Data-based App 49.3 Creating the Entity Description 49.4 Designing the User Interface 49.5 Initializing the Persistent Container 49.6 Saving Data to the Persistent Store using Core Data 49.7 Retrieving Data from the Persistent Store using Core Data 49.8 Building and Running the Example App 49.9 Summary 50. An Introduction to CloudKit Data Storage on iOS 16 50.1 An Overview of CloudKit 50.2 CloudKit Containers 50.3 CloudKit Public Database 50.4 CloudKit Private Databases 50.5 Data Storage and Transfer Quotas 50.6 CloudKit Records 50.7 CloudKit Record IDs 50.8 CloudKit References 50.9 CloudKit Assets 50.10 Record Zones 50.11 CloudKit Sharing 50.12 CloudKit Subscriptions 50.13 Obtaining iCloud User Information 50.14 CloudKit Console 50.15 Summary 51. An iOS 16 CloudKit Example 51.1 About the Example CloudKit Project 51.2 Creating the CloudKit Example Project 51.3 Designing the User Interface 51.4 Establishing Outlets and Actions 51.5 Implementing the notifyUser Method 51.6 Accessing the Private Database 51.7 Hiding the Keyboard 51.8 Implementing the selectPhoto method 51.9 Saving a Record to the Cloud Database 51.10 Testing the Record Saving Method 51.11 Reviewing the Saved Data in the CloudKit Console 51.12 Searching for Cloud Database Records 51.13 Updating Cloud Database Records 51.14 Deleting a Cloud Record 51.15 Testing the App 51.16 Summary 52. An Overview of iOS 16 Multitouch, Taps, and Gestures 52.1 The Responder Chain 52.2 Forwarding an Event to the Next Responder 52.3 Gestures 52.4 Taps 52.5 Touches 52.6 Touch Notification Methods 52.6.1 touchesBegan method 52.6.2 touchesMoved method 52.6.3 touchesEnded method 52.6.4 touchesCancelled method 52.7 Touch Prediction 52.8 Touch Coalescing 52.9 Summary 53. An Example iOS 16 Touch, Multitouch, and Tap App 53.1 The Example iOS Tap and Touch App 53.2 Creating the Example iOS Touch Project 53.3 Designing the User Interface 53.4 Enabling Multitouch on the View 53.5 Implementing the touchesBegan Method 53.6 Implementing the touchesMoved Method 53.7 Implementing the touchesEnded Method 53.8 Getting the Coordinates of a Touch 53.9 Building and Running the Touch Example App 53.10 Checking for Touch Predictions 53.11 Accessing Coalesced Touches 53.12 Summary 54. Detecting iOS 16 Touch Screen Gesture Motions 54.1 The Example iOS 16 Gesture App 54.2 Creating the Example Project 54.3 Designing the App User Interface 54.4 Implementing the touchesBegan Method 54.5 Implementing the touchesMoved Method 54.6 Implementing the touchesEnded Method 54.7 Building and Running the Gesture Example 54.8 Summary 55. Identifying Gestures using iOS 16 Gesture Recognizers 55.1 The UIGestureRecognizer Class 55.2 Recognizer Action Messages 55.3 Discrete and Continuous Gestures 55.4 Obtaining Data from a Gesture 55.5 Recognizing Tap Gestures 55.6 Recognizing Pinch Gestures 55.7 Detecting Rotation Gestures 55.8 Recognizing Pan and Dragging Gestures 55.9 Recognizing Swipe Gestures 55.10 Recognizing Long Touch (Touch and Hold) Gestures 55.11 Summary 56. An iOS 16 Gesture Recognition Tutorial 56.1 Creating the Gesture Recognition Project 56.2 Designing the User Interface 56.3 Implementing the Action Methods 56.4 Testing the Gesture Recognition Application 56.5 Summary 57. Implementing Touch ID and Face ID Authentication in iOS 16 Apps 57.1 The Local Authentication Framework 57.2 Checking for Biometric Authentication Availability 57.3 Identifying Authentication Options 57.4 Evaluating Biometric Policy 57.5 A Biometric Authentication Example Project 57.6 Checking for Biometric Availability 57.7 Seeking Biometric Authentication 57.8 Adding the Face ID Privacy Statement 57.9 Testing the App 57.10 Summary 58. Drawing iOS 16 2D Graphics with Core Graphics 58.1 Introducing Core Graphics and Quartz 2D 58.2 The draw Method 58.3 Points, Coordinates, and Pixels 58.4 The Graphics Context 58.5 Working with Colors in Quartz 2D 58.6 Summary 59. Interface Builder Live Views and iOS 16 Embedded Frameworks 59.1 Embedded Frameworks 59.2 Interface Builder Live Views 59.3 Creating the Example Project 59.4 Adding an Embedded Framework 59.5 Implementing the Drawing Code in the Framework 59.6 Making the View Designable 59.7 Making Variables Inspectable 59.8 Summary 60. An iOS 16 Graphics Tutorial using Core Graphics and Core Image 60.1 The iOS Drawing Example App 60.2 Creating the New Project 60.3 Creating the UIView Subclass 60.4 Locating the draw Method in the UIView Subclass 60.5 Drawing a Line 60.6 Drawing Paths 60.7 Drawing a Rectangle 60.8 Drawing an Ellipse or Circle 60.9 Filling a Path with a Color 60.10 Drawing an Arc 60.11 Drawing a Cubic Bézier Curve 60.12 Drawing a Quadratic Bézier Curve 60.13 Dashed Line Drawing 60.14 Drawing Shadows 60.15 Drawing Gradients 60.16 Drawing an Image into a Graphics Context 60.17 Image Filtering with the Core Image Framework 60.18 Summary 61. iOS 16 Animation using UIViewPropertyAnimator 61.1 The Basics of UIKit Animation 61.2 Understanding Animation Curves 61.3 Performing Affine Transformations 61.4 Combining Transformations 61.5 Creating the Animation Example App 61.6 Implementing the Variables 61.7 Drawing in the UIView 61.8 Detecting Screen Touches and Performing the Animation 61.9 Building and Running the Animation App 61.10 Implementing Spring Timing 61.11 Summary 62. iOS 16 UIKit Dynamics – An Overview 62.1 Understanding UIKit Dynamics 62.2 The UIKit Dynamics Architecture 62.2.1 Dynamic Items 62.2.2 Dynamic Behaviors 62.2.3 The Reference View 62.2.4 The Dynamic Animator 62.3 Implementing UIKit Dynamics in an iOS App 62.4 Dynamic Animator Initialization 62.5 Configuring Gravity Behavior 62.6 Configuring Collision Behavior 62.7 Configuring Attachment Behavior 62.8 Configuring Snap Behavior 62.9 Configuring Push Behavior 62.10 The UIDynamicItemBehavior Class 62.11 Combining Behaviors to Create a Custom Behavior 62.12 Summary 63. An iOS 16 UIKit Dynamics Tutorial 63.1 Creating the UIKit Dynamics Example Project 63.2 Adding the Dynamic Items 63.3 Creating the Dynamic Animator Instance 63.4 Adding Gravity to the Views 63.5 Implementing Collision Behavior 63.6 Attaching a View to an Anchor Point 63.7 Implementing a Spring Attachment Between two Views 63.8 Summary 64. Integrating Maps into iOS 16 Apps using MKMapItem 64.1 MKMapItem and MKPlacemark Classes 64.2 An Introduction to Forward and Reverse Geocoding 64.3 Creating MKPlacemark Instances 64.4 Working with MKMapItem 64.5 MKMapItem Options and Configuring Directions 64.6 Adding Item Details to an MKMapItem 64.7 Summary 65. An Example iOS 16 MKMapItem App 65.1 Creating the MapItem Project 65.2 Designing the User Interface 65.3 Converting the Destination using Forward Geocoding 65.4 Launching the Map 65.5 Building and Running the App 65.6 Summary 66. Getting Location Information using the iOS 16 Core Location Framework 66.1 The Core Location Manager 66.2 Requesting Location Access Authorization 66.3 Configuring the Desired Location Accuracy 66.4 Configuring the Distance Filter 66.5 Continuous Background Location Updates 66.6 The Location Manager Delegate 66.7 Starting and Stopping Location Updates 66.8 Obtaining Location Information from CLLocation Objects 66.8.1 Longitude and Latitude 66.8.2 Accuracy 66.8.3 Altitude 66.9 Getting the Current Location 66.10 Calculating Distances 66.11 Summary 67. An Example iOS 16 Location App 67.1 Creating the Example iOS 16 Location Project 67.2 Designing the User Interface 67.3 Configuring the CLLocationManager Object 67.4 Setting up the Usage Description Keys 67.5 Implementing the startWhenInUse Method 67.6 Implementing the startAlways Method 67.7 Implementing the resetDistance Method 67.8 Implementing the App Delegate Methods 67.9 Building and Running the Location App 67.10 Adding Continuous Background Location Updates 67.11 Summary 68. Working with Maps on iOS 16 with MapKit and the MKMapView Class 68.1 About the MapKit Framework 68.2 Understanding Map Regions 68.3 Getting Transit ETA Information 68.4 About the MKMapView Tutorial 68.5 Creating the Map Project 68.6 Adding the Navigation Controller 68.7 Creating the MKMapView Instance and Toolbar 68.8 Obtaining Location Information Permission 68.9 Setting up the Usage Description Keys 68.10 Configuring the Map View 68.11 Changing the MapView Region 68.12 Changing the Map Type 68.13 Testing the MapView App 68.14 Updating the Map View based on User Movement 68.15 Summary 69. Working with MapKit Local Search in iOS 16 69.1 An Overview of iOS Local Search 69.2 Adding Local Search to the MapSample App 69.3 Adding the Local Search Text Field 69.4 Performing the Local Search 69.5 Testing the App 69.6 Customized Annotation Markers 69.7 Annotation Marker Clustering 69.8 Summary 70. Using MKDirections to get iOS 16 Map Directions and Routes 70.1 An Overview of MKDirections 70.2 Adding Directions and Routes to the MapSample App 70.3 Adding the New Classes to the Project 70.4 Configuring the Results Table View 70.5 Implementing the Result Table View Segue 70.6 Adding the Route Scene 70.7 Identifying the User’s Current Location 70.8 Getting the Route and Directions 70.9 Establishing the Route Segue 70.10 Testing the App 70.11 Summary 71. Accessing the iOS 16 Camera and Photo Library 71.1 The UIImagePickerController Class 71.2 Creating and Configuring a UIImagePickerController Instance 71.3 Configuring the UIImagePickerController Delegate 71.4 Detecting Device Capabilities 71.5 Saving Movies and Images 71.6 Summary 72. An Example iOS 16 Camera App 72.1 An Overview of the App 72.2 Creating the Camera Project 72.3 Designing the User Interface 72.4 Implementing the Action Methods 72.5 Writing the Delegate Methods 72.6 Seeking Camera and Photo Library Access 72.7 Building and Running the App 72.8 Summary 73. iOS 16 Video Playback using AVPlayer and AVPlayerViewController 73.1 The AVPlayer and AVPlayerViewController Classes 73.2 The iOS Movie Player Example App 73.3 Designing the User Interface 73.4 Initializing Video Playback 73.5 Build and Run the App 73.6 Creating an AVPlayerViewController Instance from Code 73.7 Summary 74. An iOS 16 Multitasking Picture-in-Picture Tutorial 74.1 An Overview of Picture-in-Picture Multitasking 74.2 Adding Picture-in-Picture Support to the AVPlayerDemo App 74.3 Adding the Navigation Controller 74.4 Setting the Audio Session Category 74.5 Implementing the Delegate 74.6 Opting Out of Picture-in-Picture Support 74.7 Additional Delegate Methods 74.8 Summary 75. An Introduction to Extensions in iOS 16 75.1 iOS Extensions – An Overview 75.2 Extension Types 75.2.1 Share Extension 75.2.2 Action Extension 75.2.3 Photo Editing Extension 75.2.4 Document Provider Extension 75.2.5 Custom Keyboard