iOS 17 Programming for Beginners - Eighth Edition

Book description

Embark on an exciting iOS app development journey with Swift 5.9, Xcode 15, and iOS 17. This hands-on guide equips you with the skills to create captivating apps and thrive in the competitive App Store landscape. Purchase of the print or Kindle book includes a free eBook in PDF format.

Key Features

  • Dive into the latest iOS 17 features and Swift 5.9 through hands-on projects
  • Develop robust apps with top design patterns used by professionals
  • Expand your app's reach by effortlessly converting it for iPad, Mac, and visionOS

Book Description

In a world with nearly 2 million apps on the App Store, the demand for skilled iOS developers has never been higher. "iOS 17 Programming for Beginners, Eighth Edition" is your gateway to this lucrative and dynamic field. This hands-on guide is tailored for those who are new to iOS and takes you on a journey from learning the Swift language to crafting your own app and seeing it thrive on the App Store.

Our approach is hands-on and practical. Each chapter is designed to be a stepping stone in your development journey, providing step-by-step tutorials, real-life examples, and clear explanations of complex concepts. As you progress, you'll not only be skilled in Swift but also incorporate cutting-edge technologies into your apps. You'll learn how to publish your creations and harness the power of iOS 17 through a straightforward and easy to program example app divided into manageable parts.

By the time you've completed this book, you'll possess the skills and knowledge to not only develop and publish captivating apps but also leverage online resources to continually enhance your app development prowess.

What you will learn

  • Discover the world of Xcode 15 and Swift 5.9, laying the foundation for your iOS development journey
  • Implement the latest iOS 17 features through a hands-on example app, ensuring your apps remain innovative and engaging
  • Build and deploy iOS apps using industry-standard design patterns and best practices.
  • Implement the Model-View-Controller (MVC) design pattern to create robust and organized applications
  • Expand your app's reach by effortlessly converting it for iPad, Mac, and visionOS
  • Dive into UIKit, the essential framework for large-scale iOS projects

Who this book is for

This book is tailored for individuals with minimal coding experience who are new to the world of Swift and iOS app development. A basic understanding of programming concepts is recommended.

Table of contents

  1. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Get in touch
  2. Part 1: Swift
  3. Exploring Xcode
    1. Technical requirements
    2. Downloading and installing Xcode from the App Store
    3. Exploring the Xcode user interface
    4. Running your app in Simulator
      1. Understanding the Devices and Build sections
    5. Running your app on an iOS device
      1. Trusting the Developer App certificate on your iOS device
    6. Summary
  4. Simple Values and Types
    1. Technical requirements
    2. Introducing Swift playgrounds
      1. Customizing fonts and colors
      2. Running playground code
    3. Exploring data types
      1. Representing integers
      2. Representing floating-point numbers
      3. Representing strings
      4. Representing Booleans
      5. Using common data types in the playground
    4. Exploring constants and variables
    5. Understanding type inference and type safety
      1. Using type annotation to specify a type
      2. Using type safety to check values
    6. Exploring operators
      1. Using arithmetic operators
      2. Using compound assignment operators
      3. Using comparison operators
      4. Using logical operators
      5. Performing string operations
    7. Using the print() statement
    8. Summary
  5. Conditionals and Optionals
    1. Technical requirements
    2. Introducing conditionals
      1. Using if statements
      2. Using switch statements
    3. Introducing optionals and optional binding
    4. Summary
  6. Range Operators and Loops
    1. Technical requirements
    2. Exploring range operators
    3. Exploring loops
      1. The for-in loop
      2. The while loop
      3. The repeat-while loop
    4. Summary
  7. Collection Types
    1. Technical requirements
    2. Exploring arrays
      1. Creating an array
      2. Checking the number of elements in an array
      3. Adding a new element to an array
      4. Accessing an array element
      5. Assigning a new value to a specified index
      6. Removing an element from an array
      7. Iterating over an array
    3. Exploring dictionaries
      1. Creating a dictionary
      2. Checking the number of elements in a dictionary
      3. Adding a new element to a dictionary
      4. Accessing a dictionary element
      5. Assigning a new value to an existing key
      6. Removing an element from a dictionary
      7. Iterating over a dictionary
    4. Exploring sets
      1. Creating a set
      2. Checking the number of elements in a set
      3. Adding a new element to a set
      4. Checking whether a set contains an element
      5. Removing an item from a set
      6. Iterating over a set
      7. Performing set operations
      8. Understanding set membership and equality
    5. Summary
  8. Functions and Closures
    1. Technical requirements
    2. Exploring functions
      1. Creating a function
      2. Using custom argument labels
      3. Using nested functions
      4. Using functions as return types
      5. Using functions as parameters
      6. Using a guard statement to exit a function early
    3. Exploring closures
      1. Simplifying closures
    4. Summary
  9. Classes, Structures, and Enumerations
    1. Technical requirements
    2. Understanding classes
      1. Creating a class declaration
      2. Making an instance of the class
      3. Making a subclass
      4. Overriding a superclass method
    3. Understanding structures
      1. Creating a structure declaration
      2. Making an instance of the structure
      3. Comparing value types and reference types
      4. Deciding between classes and structures
    4. Understanding enumerations
      1. Creating an enumeration
    5. Summary
  10. Protocols, Extensions, and Error Handling
    1. Technical requirements
    2. Exploring protocols
      1. Creating a protocol declaration
    3. Exploring extensions
      1. Adopting a protocol via an extension
      2. Creating an array of different types of objects
    4. Exploring error handling
    5. Summary
  11. Swift Concurrency
    1. Technical requirements
    2. Understanding Swift concurrency
    3. Examining an app without concurrency
    4. Updating the app using async/await
    5. Improving efficiency using async-let
    6. Summary
  12. Part 2: Design
  13. Setting Up the User Interface
    1. Technical requirements
    2. Learning useful terms in iOS development
    3. A tour of the JRNL app
      1. Using the Journal List screen
      2. Using the Add New Journal Entry screen
      3. Using the Journal Entry Detail screen
      4. Using the Map screen
    4. Modifying your Xcode project
    5. Setting up a tab bar controller scene
      1. Setting the tab bar button titles and icons
      2. Embedding view controllers in navigation controllers
      3. Configuring Interface Builder
    6. Summary
  14. Building Your User Interface
    1. Technical requirements
    2. Adding a table view to the Journal List screen
    3. Connecting storyboard elements to the view controller
    4. Configuring data source methods for the table view
      1. Setting the delegate and data source properties of the table view
      2. Adopting the UITableViewDataSource and UITableViewDelegate protocols
    5. Presenting a view modally
      1. Adding a bar button to the navigation bar
      2. Adding a new view controller scene
      3. Adding Cancel and Save buttons to the navigation bar
    6. Summary
  15. Finishing Up Your User Interface
    1. Technical requirements
    2. Implementing the Journal Entry Detail screen
    3. Implementing the Map screen
    4. Summary
  16. Modifying App Screens
    1. Technical requirements
    2. Modifying the Journal List screen
      1. Adding an image view to journalCell
      2. Adding labels to journalCell
    3. Modifying the Add New Journal Entry screen
      1. Adding a custom view to the New Entry scene
      2. Adding a switch to the New Entry scene
      3. Adding a text field and a text view to the New Entry scene
      4. Adding an image view to the New Entry scene
      5. Embedding user interface elements in a stack view
    4. Modifying the Journal Entry Detail screen
      1. Configuring the number and size of static table view cells
      2. Adding user interface elements to static table view cells
    5. Summary
  17. Part 3: Code
  18. Getting Started with MVC and Table Views
    1. Technical requirements
    2. Understanding the Model-View-Controller design pattern
      1. Exploring view controllers
    3. Understanding table views
      1. Conforming to the UITableViewDataSource protocol
      2. Conforming to the UITableViewDelegate protocol
      3. Creating a TableViewExampleController instance
    4. Revisiting the Journal List screen
    5. Summary
  19. Getting Data into Table Views
    1. Technical requirements
    2. Understanding model objects
    3. Creating a class to represent a journal entry
    4. Creating sample data
    5. Displaying data in a table view
      1. Creating a custom UITableViewCell subclass
      2. Connecting the outlets in journalCell
      3. Updating the data source methods in JournalListViewController
    6. Summary
  20. Passing Data between View Controllers
    1. Technical requirements
    2. Passing data from the Add New Journal Entry screen to the Journal List screen
      1. Creating the AddJournalEntryViewController class
      2. Connecting the UI elements to the AddJournalEntryViewController class
      3. Creating a JournalEntry instance from user input
      4. Updating the table view with a new journal entry
    3. Removing rows from a table view
    4. Exploring text field and text view delegate methods
    5. Passing data from the Journal List screen to the Journal Entry Detail screen
      1. Creating the JournalEntryDetailViewController class
      2. Connecting the UI elements to the JournalEntryDetailViewController class
      3. Displaying the details of a journal entry
      4. Displaying the details of a selected journal entry
    6. Summary
  21. Getting Started with Core Location and MapKit
    1. Technical requirements
    2. Getting your device location using the Core Location framework
      1. Modifying the AddJournalEntryViewController class
      2. Modifying the Info.plist file
      3. Creating the MapViewController class
    3. Updating the JournalEntry class to conform to the MKAnnotation protocol
    4. Displaying annotation views on the Map screen
      1. Configuring a pin to display a callout
      2. Going from the Map screen to the Journal Entry Detail screen
    5. Displaying a map snapshot on the Journal Entry Detail screen
    6. Summary
  22. Getting Started with JSON Files
    1. Technical requirements
    2. Creating a singleton
    3. Modifying the JournalEntry class to be JSON-compatible
    4. Loading and saving JSON data
    5. Summary
  23. Getting Started with Custom Views
    1. Technical requirements
    2. Creating a custom UIStackView subclass
    3. Adding your custom view to the Add New Journal Entry screen
    4. Adding your custom view to the Journal Entry Detail screen
    5. Summary
  24. Getting Started with the Camera and Photo Library
    1. Technical requirements
    2. Creating a new UIImagePickerController instance
    3. Implementing UIImagePickerControllerDelegate methods
    4. Getting permission to use the camera or photo library
    5. Summary
  25. Getting Started with Search
    1. Technical requirements
    2. Implementing a search bar for the Journal List screen
    3. Modifying table view data source methods
    4. Modifying the prepare(for:sender:) method
    5. Modifying the method to remove journal entries
    6. Summary
  26. Getting Started with Collection Views
    1. Technical requirements
    2. Understanding collection views
    3. Modifying the Journal List screen to use a collection view
      1. Replacing the table view with a collection view
      2. Adding user interface elements to the collection view cell
      3. Modifying the JournalListTableViewCell class
      4. Modifying the JournalListViewController class
    4. Dynamically modifying collection view cell size using size classes
      1. Understanding size classes
      2. Modifying the JournalListViewController class
    5. Testing your app on different devices
    6. Summary
  27. Part 4: Features
  28. Getting Started with SwiftData
    1. Technical requirements
    2. Introducing SwiftData
    3. Modifying the JournalEntry class
    4. Implementing SwiftData components
    5. Modifying the JournalListViewController class
    6. Summary
  29. Getting Started with SwiftUI
    1. Technical requirements
    2. Creating a SwiftUI Xcode project
    3. Creating the Journal List screen
    4. Adding model objects and configuring navigation
    5. Using MapKit for SwiftUI
    6. Completing the Journal Entry Detail screen
    7. Summary
  30. Getting Started with Widgets
    1. Technical requirements
    2. Introducing widgets
    3. Adding a widget target to your app
    4. Providing timeline entries to your widget
    5. Customizing your widget’s view
    6. Adding a widget to your Home and Lock screens
    7. Summary
  31. Getting Started with visionOS
    1. Technical requirements
    2. Introducing visionOS
    3. Adding a visionOS target to your project
    4. Improving your app’s appearance in visionOS
    5. Adding 3D objects to your app
    6. Summary
  32. Testing and Submitting Your App to the App Store
    1. Technical requirements
    2. Getting an Apple Developer account
    3. Exploring your Apple Developer account
      1. Generating a certificate signing request
      2. Creating development and distribution certificates
      3. Registering an App ID
      4. Registering your devices
      5. Creating provisioning profiles
    4. Submitting your app to the App Store
      1. Creating icons for your app
      2. Creating screenshots for your app
      3. Creating an App Store listing
      4. Creating an archive build
      5. Completing the information in App Store Connect
    5. Testing your app
      1. Testing your app internally
      2. Testing your app externally
    6. Summary
  33. Other Books You May Enjoy
  34. Index

Product information

  • Title: iOS 17 Programming for Beginners - Eighth Edition
  • Author(s): Ahmad Sahar
  • Release date: October 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781837630561