0%

Learn iOS app development and work with the latest Apple development tools

Key Features

  • Explore the latest features of Xcode 12 and the Swift 5.3 programming language in this updated fifth edition
  • Kick-start your iOS programming career and have fun building your own iOS apps
  • Discover the new features of iOS 14 such as Mac Catalyst, SwiftUI, widgets and App Clips

Book Description

If you're looking to work and experiment with powerful iOS 14 features such as widgets and App Clips to create your own apps, this iOS programming guide is for you. The book offers a comprehensive introduction for experienced programmers who are new to iOS, taking you through the entire process of learning the Swift language, writing your own apps, and publishing them on the App Store.

Fully updated to cover the new iOS 14 features, along with Xcode 12 and Swift 5.3, this fifth edition of iOS 14 Programming for Beginners starts with an introduction to the Swift programming language and shows you how to accomplish common programming tasks with it. You'll then start building the user interface (UI) of a complete real-world app using the storyboards feature in the latest version of Xcode and implement the code for views, view controllers, data managers, and other aspects of mobile apps. The book will also help you apply iOS 14 features to existing apps and introduce you to SwiftUI, a new way to build apps for all Apple devices. Finally, you'll set up testers for your app and understand what you need to do to publish your app on the App Store.

By the end of this book, you'll not only be well versed in writing and publishing applications, but you'll also be able to apply your iOS development skills to enhance existing apps.

What you will learn

  • Get to grips with the fundamentals of Xcode 12 and Swift 5.3, the building blocks of iOS development
  • Understand how to prototype an app using storyboards
  • Discover the Model-View-Controller design pattern and how to implement the desired functionality within an app
  • Implement the latest iOS features, such as widgets and App Clips
  • Convert an existing iPad app into an Apple Silicon Mac app
  • Design, deploy, and test your iOS applications with design patterns and best practices

Who this book is for

This book is for anyone who has programming experience but is new to Swift and iOS app development. Experienced programmers looking to explore the latest iOS 14 features will also find this book useful.

Table of Contents

  1. iOS 14 Programming for Beginners Fifth Edition
  2. Why subscribe?
  3. Contributors
  4. About the author
  5. About the reviewers
  6. Packt is searching for authors like you
  7. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Code in Action
    6. Download the color images
    7. Conventions used
    8. Get in touch
    9. Reviews
  8. Section 1: Swift
  9. Chapter 1: Getting Familiar with Xcode
    1. Technical requirements
    2. Downloading and installing Xcode from the App Store
    3. Understanding the Xcode user interface
    4. Running the app in the iOS simulator
    5. Using an iOS device for development
    6. Connecting an iOS device wirelessly
    7. Summary
  10. Chapter 2: Simple Values and Types
    1. Technical requirements
    2. Understanding Swift Playgrounds
    3. Customizing fonts and colors
    4. Running playground code
    5. Exploring data types
    6. Representing integers
    7. Representing floating-point numbers
    8. Representing Booleans
    9. Representing strings
    10. Using common data types in the playground
    11. Exploring constants and variables
    12. Understanding type inference and type safety
    13. Using type annotation to specify a type
    14. Using type safety to check values
    15. Exploring operators
    16. Using arithmetic operators
    17. Using compound assignment operators
    18. Using comparison operators
    19. Using logical operators
    20. Performing string operations
    21. Using the print() instruction
    22. Summary
  11. Chapter 3: Conditionals and Optionals
    1. Technical requirements
    2. Introducing conditionals
    3. Using if statements
    4. Using switch statements
    5. Introducing optionals
    6. Using optionals and optional binding
    7. Summary
  12. Chapter 4: Range Operators and Loops
    1. Technical requirements
    2. Exploring range operators
    3. Exploring loops
    4. Using the for-in loop
    5. Using the while loop
    6. The repeat-while loop
    7. Summary
  13. Chapter 5: Collection Types
    1. Technical requirements
    2. Understanding arrays
    3. Creating an array
    4. Checking the number of elements in an array
    5. Adding a new element to an array
    6. Accessing an array element
    7. Assigning a new value to a particular index
    8. Removing an element from an array
    9. Iterating over an array
    10. Understanding dictionaries
    11. Creating a dictionary
    12. Checking the number of elements in a dictionary
    13. Adding a new element to a dictionary
    14. Accessing a dictionary element
    15. Assigning a new value to an existing key
    16. Removing an element from a dictionary
    17. Iterating over a dictionary
    18. Understanding sets
    19. Creating a set
    20. Checking the number of elements in a set
    21. Adding a new element to a set
    22. Checking whether a set contains an element
    23. Removing an item from a set
    24. Iterating over a set
    25. Exploring set operations
    26. Exploring set membership and equality
    27. Summary
  14. Chapter 6: Functions and Closures
    1. Technical requirements
    2. Understanding functions
    3. Creating a function
    4. Using custom argument labels
    5. Using nested functions
    6. Using functions as return types
    7. Using functions as parameters
    8. Using a guard statement to exit a function early
    9. Understanding closures
    10. Simplifying closures
    11. Summary
  15. Chapter 7: Classes, Structures, and Enumerations
    1. Technical requirements
    2. Understanding classes
    3. Creating a class declaration
    4. Making an instance of the class
    5. Making a subclass
    6. Overriding a superclass method
    7. Understanding structures
    8. Creating a structure declaration
    9. Making an instance of the structure
    10. Comparing value types and references types
    11. Deciding between classes and structures
    12. Understanding enumerations
    13. Creating an enumeration
    14. Summary
  16. Chapter 8: Protocols, Extensions, and Error Handling
    1. Technical requirements
    2. Understanding protocols
    3. Creating a protocol declaration
    4. Understanding extensions
    5. Adopting a protocol via an extension
    6. Creating an array of different types of objects
    7. Exploring error handling
    8. Summary
  17. Section 2:Design
  18. Chapter 9: Setting Up the User Interface
    1. Technical requirements
    2. Learning useful terms in iOS development
    3. Touring the Let's Eat app
    4. Using the Explore screen
    5. Using the Locations screen
    6. Using the Restaurant List screen
    7. Using the Restaurant Detail screen
    8. Using the Review Form screen
    9. Using the Photo Filter screen
    10. Using the Map screen
    11. Creating a new Xcode project
    12. Setting up a tab bar controller scene
    13. Setting the titles of the tab bar's buttons
    14. Adding the Assets.xcassets file
    15. Adding the icons for the Explore and Map buttons
    16. Setting up the Launch screen
    17. Configuring the Launch screen's background color
    18. Adding a logo and constraints to the Launch screen
    19. Configuring Interface Builder
    20. Summary
  19. Chapter 10: Building Your User Interface
    1. Adding a collection view to the Explore screen
    2. Connecting storyboard elements to outlets in a view controller
    3. Adding a Cocoa Touch Class file to your project
    4. Connecting storyboard elements to the view controller
    5. Configuring data source methods for the collection view
    6. Setting the delegate and data source properties of the collection view
    7. Adopting the UICollectionViewDataSource and UICollectionViewDelegate protocols
    8. Adding a section header to the collection view
    9. Configuring storyboard element sizes
    10. Presenting a view modally
    11. Adding a button to the collection view header
    12. Adding a new view controller scene
    13. Adding Cancel and Done buttons to the navigation bar
    14. Summary
  20. Chapter 11: Finishing Up Your User Interface
    1. Technical requirements
    2. Adding a table view to the Locations screen
    3. Implementing the Restaurant List screen
    4. Declaring the RestaurantListViewController class
    5. Adopting the delegate and data source protocols
    6. Presenting the Restaurant List screen
    7. Implementing the Restaurant Detail screen
    8. Implementing the Review Form screen
    9. Implementing the Map screen
    10. Summary
  21. Chapter 12: Modifying and Configuring Cells
    1. Technical requirements
    2. Modifying the Explore screen section header
    3. Adding Auto Layout to the Explore screen's section header
    4. Modifying the exploreCell collection view cell
    5. Modifying the restaurantCell collection view cell
    6. Adding Auto Layout constraints to the restaurantCell collection view cell
    7. Configuring the locationCell table view cell
    8. Summary
  22. Section 3:Code
  23. Chapter 13: Getting Started with MVC and Collection Views
    1. Technical requirements
    2. Understanding the Model-View-Controller design pattern
    3. Exploring controllers and classes
    4. Understanding collection views
    5. Conforming to the UICollectionViewDataSource protocol
    6. Creating a CollectionViewExampleController instance
    7. Revisiting the Explore and Restaurant List screens
    8. Summary
  24. Chapter 14: Getting Data into Collection Views
    1. Technical requirements
    2. Understanding model objects
    3. Understanding .plist files
    4. Creating a structure to represent a cuisine
    5. Implementing a data manager class to read data from a .plist file
    6. Using the data manager to initialize ExploreItem instances
    7. Displaying data in a collection view
    8. Connecting the outlets in exploreCell
    9. Implementing additional data manager methods
    10. Updating the data source methods in ExploreViewController
    11. Summary
    12. Technical requirements
    13. Understanding table views
    14. Creating the LocationViewController class
    15. Connecting the table view to the LocationViewController class
    16. Adding the data source and delegate methods
    17. Adding location data for the table view
    18. Creating the LocationDataManager class
    19. Displaying data in a table view
    20. Summary
  25. Chapter 16: Getting Started with MapKit
    1. Technical requirements
    2. Understanding and creating annotations
    3. Creating the RestaurantItem class
    4. Creating the MapDataManager class
    5. Creating the DataManager protocol
    6. Refactoring the MapDataManager class
    7. Refactoring the ExploreDataManager class
    8. Adding annotations to a map view
    9. Creating the MapViewController class
    10. Connecting the outlets for the map view
    11. Setting the map view region to be displayed
    12. Displaying MKAnnotationView instances on the map view
    13. Creating custom MKAnnotationView instances
    14. Going from the Map screen to the Restaurant Detail screen
    15. Creating and configuring a storyboard reference
    16. Performing the showDetail segue
    17. Passing data to the Restaurant Detail screen
    18. Organizing your code
    19. Refactoring the ExploreViewController class
    20. Using the // MARK: syntax
    21. Refactoring the RestaurantListViewController class
    22. Refactoring the LocationViewController class
    23. Refactoring the MapViewController class
    24. Summary
  26. Chapter 17: Getting Started with JSON Files
    1. Technical requirements
    2. Getting data from JSON files
    3. Understanding the JSON format
    4. Creating the RestaurantDataManager class
    5. Using data from JSON files in your app
    6. Configuring the MapDataManager instance to use data from the RestaurantDataManager instance
    7. Storing a user-selected location
    8. Adding a view controller for the section header on the Explore screen
    9. Connecting the section header's label to the ExploreViewController class
    10. Adding an unwind action method to the Done button
    11. Selecting only one location on the Locations screen
    12. Passing location and cuisine information to the RestaurantListViewController instance
    13. Creating a view controller for the cells on the Restaurant List screen
    14. Connecting the outlets for the RestaurantCell class
    15. Displaying a custom UIView to indicate no data is available
    16. Displaying a list of restaurants on the Restaurant List screen
    17. Summary
  27. Chapter 18: Displaying Data in a Static Table View
    1. Technical requirements
    2. Setting up outlets for the RestaurantDetailViewController class
    3. Displaying data in the static table view
    4. Passing data to the RestaurantDetailViewController instance
    5. Summary
  28. Chapter 19: Getting Started with Custom UIControls
    1. Technical requirements
    2. Creating a custom UIControl subclass
    3. Displaying stars in your custom UIControl subclass
    4. Adding support for touch events
    5. Implementing an unwind method for the Cancel button
    6. Creating the ReviewFormViewController class
    7. Summary
  29. Chapter 20: Getting Started with Cameras and Photo Libraries
    1. Technical requirements
    2. Understanding filters
    3. Creating model objects for the Photo Filter screen
    4. Creating the ImageFiltering protocol
    5. Creating view controllers for the Photo Filter screen
    6. Creating a view controller for the collection view cells
    7. Creating a view controller for the Photo Filter screen
    8. Getting permission to use the camera or photo library
    9. Summary
  30. Chapter 21: Understanding Core Data
    1. Technical requirements
    2. Introducing Core Data
    3. Implementing Core Data components for your app
    4. Creating a data model
    5. Creating ReviewItem
    6. Creating RestaurantPhotoItem
    7. Creating a Core Data manager
    8. Understanding how saving and loading works
    9. Passing RestaurantID to the ReviewFormViewController instance
    10. Updating the PhotoFilterViewController class to save photos
    11. Displaying saved reviews and photos on the Restaurant Detail screen
    12. Calculating a restaurant's overall rating
    13. Summary
  31. Section 4:Features
  32. Chapter 22: Getting Started with Apple Silicon Macs
    1. Technical requirements
    2. Fixing user interface issues
    3. Making your app run on all iOS devices
    4. Identifying device type
    5. Understanding size classes
    6. Updating the Explore screen
    7. Updating the Restaurant List screen
    8. Updating the app to work on macOS
    9. Summary
  33. Chapter 23: Getting Started with SwiftUI
    1. Technical requirements
    2. Creating a SwiftUI Xcode Project
    3. Creating the Restaurant List screen
    4. Adding model objects and configuring navigation
    5. Using UIKit and SwiftUI views together
    6. Completing the Restaurant Detail screen
    7. Summary
  34. Chapter 24: 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 Screen
    7. Summary
  35. Chapter 25: Getting Started with App Clips
    1. Technical requirements
    2. Introducing app clips
    3. Adding an app clip to your project
    4. Configuring your app clip
    5. Passing restaurant data to the Restaurant Detail screen
    6. Summary
  36. Chapter 26: Testing and Submitting Your App to the App Store
    1. Technical requirements
    2. Getting an Apple Developer account
    3. Exploring your Apple Developer account
    4. Generating a certificate signing request
    5. Creating development and distribution certificates
    6. Registering an App ID
    7. Registering your devices
    8. Creating provisioning profiles
    9. Submitting your app to the App Store
    10. Creating icons for your app
    11. Creating screenshots for your app
    12. Creating an App Store listing
    13. Creating an archive build
    14. Completing the information in App Store Connect
    15. Testing your app
    16. Testing your app internally
    17. Testing your app externally
    18. Summary
  37. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think
18.217.116.183