0%

Book Description

Learn to create professional-grade iOS applications for the App Store using the latest iOS 12 features and other helpful tools

Key Features

  • Explore the distinctive design principles that define the iOS user experience
  • Train and use machine learning models with Core ML 2 and Create ML
  • Delve into advanced animations with UIViewPropertyAnimator and UIKitDynamics

Book Description

With Apple users spending more money in the App Store, there are plenty of development opportunities for professional iOS developers.

This Learning Path is a direct route to iOS development, which will take you through the basics and help you put principles into practice. For experienced programmers, this book will help you gain insights into the latest iOS 12 features. This book is also useful for beginners who want to gain expertise in iOS development. You'll start with an introduction to iOS development, Xcode, and Swift. To give your app the edge, you'll get up to speed with advanced iOS topics, such as gestures and animations. Next, you will understand the latest Swift 4.2 and iOS 12 developments by incorporating new features, such as the latest in notifications, custom-UI notifications, maps, and recent additions in SiriKit. With these tools, you'll be able to write efficient, readable, and maintainable Swift code that maintains industry best practices.

By the end of the book, you will have the confidence to build iOS 12 applications that harness advanced techniques and make the best use of the latest features.

This Learning Path includes content from the following Packt products:

  • iOS 12 Programming for Beginners - Third Edition by Craig Clayton
  • Mastering iOS 12 Programming - Third Edition by Donny Wals

What you will learn

  • Build a responsive user interface (UI) and add privacy to your custom-rich notifications
  • Set up SiriKit to add voice for Siri shortcuts
  • Integrate iMessage, Siri, and more in your app through app extensions
  • Use TestFlight to collect feedback before releasing your apps on the App Store
  • Use Auto Layout to create complex layouts that look visually appealing on any device
  • Enhance your app by building your own profiling tools
  • Create engaging augmented reality experiences with ARKit 2

Who this book is for

If you are completely new to Swift, iOS, or programming and want to become an expert in developing iOS applications, this Learning Path is for you. You'll also find this Learning Path useful if you're an experienced programmer looking to explore the latest iOS 12 features.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Complete iOS 12 Development Guide
  3. About Packt
    1. Why Subscribe?
    2. Packt.com
  4. Contributors
    1. About the authors
    2. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Conventions used
    4. Get in touch
      1. Reviews
  6. Getting Familiar with Xcode
    1. Getting started
    2. The Xcode interface
      1. Navigator panel
      2. Standard editor
      3. Utilities panel
      4. Debug panel
      5. Toolbar
      6. Generic iOS device
      7. iOS device
      8. Connecting wirelessly
      9. Window pane controls
    3. Summary
  7. Building a Foundation with Swift
    1. Playgrounds – an interactive coding environment
    2. Data types – where it all starts
      1. String
      2. Integer data type
      3. Floating-point numbers
      4. Booleans
      5. Variables and constants – where data is held
        1. Creating a variable with a string
        2. Creating a variable with an integer (int)
        3. Debug and print() – detecting your bugs
        4. Adding floating-point numbers
        5. Creating a Boolean
        6. Why constants versus variables?
      6. Comments – leaving yourself notes or reminders
    3. Type safety and type inference
      1. Concatenating strings
      2. String interpolation
    4. Operations with our integers
      1. Increment and decrement
      2. Comparison operators
    5. Summary
  8. Building on the Swift Foundation
    1. Creating a Playground project
    2. The if statements – having fun with logic statements
    3. Optionals and optional bindings
      1. Why optionals?
    4. Functions
    5. Summary
  9. Digging Deeper
    1. Creating a Playground project
    2. Ranges
      1. Closed range
      2. Half-closed range
    3. Control flow
      1. The for...in loop
      2. One-sided range
      3. The while loop
      4. The repeat...while loop
    4. Summary
  10. Digging into Collections
    1. Arrays
      1. Creating an empty array
      2. Creating an array with initial values
      3. Creating a mutable array
      4. Adding items to an array
      5. Checking the number of elements in an array
      6. Checking for an empty array
      7. Retrieving a value from an array
      8. Iterating over an array
      9. Removing items from an array
    2. Dictionaries
      1. Creating a dictionary
      2. Adding and updating dictionary elements
      3. Accessing an item in a dictionary
      4. Iterating over dictionary values
      5. Iterating over dictionary keys
      6. Iterating over dictionary keys and values
      7. Checking the number of items in a dictionary
      8. Removing items from a dictionary
    3. Sets
      1. Creating an empty set
      2. Creating a set with an array literal
      3. Creating a mutable set
      4. Adding items to a set
      5. Checking whether a set contains an item
      6. Iterating over a set
      7. Intersecting two sets
      8. Joining two sets
      9. Removing items from a set
    4. Summary
  11. Starting the UI Setup
    1. Useful terms
      1. View Controllers
      2. Table View Controllers
      3. Collection View Controllers
      4. Navigation Controllers
      5. Tab Bar Controllers
      6. Storyboards
      7. Segues
      8. Stack Views
      9. Auto Layout
      10. Model View Controller (MVC)
    2. App tour
      1. The Explore tab
      2. Locations
      3. Restaurant listings
      4. Restaurant detail
      5. The Map tab
    3. Project setup
      1. Creating a new project
    4. Summary
  12. Setting Up the Basic Structure
    1. Starting from scratch
    2. Storyboard setup
      1. Adding our app assets
      2. Storyboards
        1. Creating our launch screen
        2. Adding a Navigation Controller
    3. Summary
  13. Building Our App Structure in Storyboard
    1. Adding a Collection View Controller
    2. Hooking up our outlets
    3. Creating a custom color
    4. Setting up our cell
    5. Section header
    6. Updating the grid
    7. Adding a modal
      1. Updating Bar Button Items
      2. Unwinding our Cancel button
      3. Adding our first Table View
    8. Summary
  14. Finishing Up Our App Structure in Storyboard
    1. Adding our Restaurant List View
    2. Hooking up our outlets
    3. Setting up our cell
    4. Adding the Reviews View
    5. Viewing reviews 
    6. Map Kit View
    7. Summary 
  15. Designing Cells
    1. Setting up the Explore header  
      1. Adding Auto Layout to the Explore header
      2. Setting up the Explore cell
      3. Adding Auto Layout to the Explore cell
    2. Setting up the Restaurant cell
      1. Adding Auto Layout to the Restaurant cell  
      2. The Locations cell 
    3. Summary
  16. Getting Started with the Grid
    1. Understanding the Model View Controller architecture
      1. Getting familiar with the setup
    2. Classes and structures
    3. Controllers and classes
      1. Understanding Collection Views
      2. Creating our controller
      3. Understanding Collection View controllers and Collection View cells
      4. Getting data into Collection View
      5. Understanding the data source
    4. Summary
  17. Adding Core Data to Your App
    1. Understanding the Core Data Stack
    2. Adding Core Data to an existing application
    3. Creating a Core Data model
      1. Creating the models
      2. Defining relationships
      3. Using your entities
    4. Reading and writing data in a Core Data database
      1. Understanding data persistence
      2. Persisting your models
      3. Refactoring the persistence code
      4. Reading data with a simple fetch request
      5. Filtering data with predicates
      6. Reacting to database changes
        1. Implementing NSFetchedResultsController
    5. Understanding the use of multiple instances of NSManagedObjectContext
    6. Summary
    7. Questions
    8. Further reading
  18. Fetching and Displaying Data from the Network
    1. Fetching data from the web
      1. Understanding URLSession basics
    2. Working with JSON in Swift
    3. Updating Core Data objects with fetched data
      1. Implementing the fetch logic
      2. Updating a movie with a popularity rating
      3. Visualizing multiple threads
    4. Wrapping the feature up
      1. Adding the rating to the movie cell
      2. Understanding App Transport Security
      3. Observing changes to movie ratings
    5. Summary
    6. Questions
    7. Further reading
  19. Being Proactive with Background Fetch
    1. Understanding how background fetch works
      1. Looking at background fetch from a distance
      2. Looking at background fetch in more depth
    2. Implementing the prerequisites for background fetch
      1. Adding the background fetch capability
      2. Asking iOS to wake your app
    3. Updating movies in the background
      1. Updating the data model
      2. Refactoring the existing code
    4. Updating movies in the background
      1. Preparing the helper struct
      2. Updating the movies
    5. Summary
    6. Test your knowledge
    7. Further reading
  20. Syncing Data with CloudKit
    1. Getting familiar with CloudKit
      1. Adding CloudKit to your project
      2. Exploring the CloudKit dashboard
        1. Understanding your CloudKit database
        2. Exploring the rest of your container
    2. Storing and retrieving data with CloudKit
      1. Communicating with CloudKit for the first time
      2. Listening for changes in the database
      3. Retrieving changes from CloudKit
      4. Configuring your AppDelegate
      5. Storing data in CloudKit
    3. Combining CloudKit and Core Data
      1. Preparing the Core Data models for CloudKit
      2. Importing CloudKit data
      3. Sending Core Data models to CloudKit
    4. Summary
    5. Questions
    6. Further reading
  21. Using Augmented Reality
    1. Understanding ARKit
      1. Understanding how ARKit renders content
      2. Understanding how ARKit tracks the physical environment
    2. Using ARKit Quicklook
      1. Implementing the ARKit Quicklook view controller
    3. Exploring SpriteKit
      1. Creating a SpriteKit scene
    4. Exploring SceneKit
      1. Creating a basic SceneKit scene
    5. Implementing an Augmented Reality gallery
      1. Adding image tracking
        1. Preparing images for tracking
        2. Building the image-tracking experience
      2. Placing your own content in 3D space
    6. Summary
    7. Questions
    8. Further reading
  22. Improving Apps With Location Services
    1. Requesting a user's location
      1. Asking for permission to access location data
      2. Obtaining a user's location
    2. Subscribing to location changes
    3. Setting up geofences
    4. Summary
    5. Questions
    6. Further reading
  23. Making Smarter Apps with CoreML
    1. Understanding machine learning and CoreML
      1. Understanding what machine learning is
      2. Understanding CoreML
        1. Obtaining CoreML models
        2. Using a CoreML model
    2. Combining CoreML and computer vision
      1. Understanding the Vision framework
      2. Implementing an image classifier
    3. Training your own models with CreateML
      1. Training a natural language model
      2. Training a Vision model
    4. Summary
    5. Questions
    6. Further reading
  24. Tracking Activity Using HealthKit
    1. Understanding HealthKit
      1. Requesting access to the HealthKit Store
      2. Storing and retrieving data with HealthKit
    2. Implementing a workout app
    3. Summary
    4. Questions
    5. Further reading
  25. Streamlining Experiences with Siri
    1. Understanding intents
    2. Implementing an intents extension
      1. Understanding app extensions
      2. Configuring your extension
      3. Adding vocabularies to your app
        1. Adding vocabularies through a .plist file
        2. Teaching Siri new vocabularies at runtime
      4. Handling intents in your extension
        1. Resolving the user's input
        2. Confirming the intent status
        3. Performing the desired action
    3. Adding a custom UI to Siri
    4. Implementing Siri Shortcuts
      1. Implementing shortcuts through NSUserActivity
      2. Donating shortcuts with INinteractions
    5. Summary
    6. Questions
    7. Further reading
  26. Using Media in Your App
    1. Playing audio and video
      1. Creating a simple video player
      2. Creating an audio player
        1. Implementing basic audio controls
        2. Implementing the time scrubber
        3. Displaying song metadata
      3. Playing media in the background
    2. Recording video and taking pictures
      1. Taking and storing a picture
      2. Recording and storing video
    3. Manipulating photos with Core Image
    4. Summary
    5. Questions
    6. Further reading
  27. Implementing Rich Notifications
    1. Gaining a deep understanding of notifications
    2. Scheduling and handling notifications
      1. Registering for notifications
      2. Creating notification contents
        1. Creating push notifications
        2. Creating local notifications
      3. Scheduling your notification
        1. Scheduling a timed notification
        2. Scheduling a calendar-based notification
        3. Scheduling a location-based notification
      4. Handling notifications
        1. Handling notifications in your app
        2. Managing pending and delivered notifications
        3. Adding actions to notifications
    3. Implementing grouped notifications
      1. Grouping notifications based on thread identifiers
      2. Providing a custom summary message for your notification group
    4. Implementing notification extensions
      1. Adding a service extension to your app
      2. Adding a content extension to your app
    5. Summary
    6. Questions
    7. Further reading
  28. Instant Information with a Today Extension
    1. Understanding the anatomy of a Today Extension
      1. Finding Today Extensions in iOS
      2. Understanding Today Extensions
    2. Adding a Today Extension to your app
    3. Summary
    4. Questions
    5. Further reading
  29. Exchanging Data With Drag And Drop
    1. Understanding the drag and drop experience
      1. Understanding UIDragInteractionDelegate
      2. Understanding UIDropInteractionDelegate
    2. Implementing a basic drag and drop functionality
      1. Adding drag and drop to a plain UIView
      2. Adding drag and drop to a UICollectionView
    3. Customizing the drag and drop experience
    4. Summary
    5. Questions
    6. Further reading
  30. Improved Discoverability with Spotlight and Universal Links
    1. Understanding Spotlight search
    2. Adding your app contents to the Spotlight index
      1. Indexing your app through user activity
      2. Indexing with CSSearchableItem
        1. Containing information in CSSearchableItemAttributeSet
        2. Adding CSSearchableItem instances to the search index
        3. Safely combining indexing methods
        4. Handling searchable item selection
      3. Understanding Spotlight best practices and ratings
        1. Adding metadata to your web links
        2. Registering as an indexing delegate
    3. Increasing your app's visibility with Universal Links
      1. Preparing your server for Universal Links
      2. Handling Universal Links in your app
    4. Summary
    5. Questions
    6. Further reading
  31. Extending iMessage
    1. Understanding iMessage apps
    2. Creating an iMessage sticker pack
      1. Optimizing assets for your stickers
      2. Creating a custom sticker app
    3. Implementing custom, interactive iMessage apps
      1. Understanding the iMessage app life cycle
      2. Implementing the custom compact view
      3. Implementing the expanded view
    4. Understanding sessions, messages, and conversations
      1. Composing a message
      2. Sending a message
    5. Summary
    6. Questions
    7. Further reading
  32. Discovering Bottlenecks with Instruments
    1. Exploring the Instruments suite
    2. Discovering slow code
    3. Closing memory leaks
      1. Understanding what a memory leak is
        1. Preventing objects from using infinite memory
        2. Avoiding reference cycles
      2. Discovering memory leaks
    4. Creating your own Instrument
      1. Adding signpost logging to your app
      2. Building an Instruments Package
    5. Summary
    6. Questions
    7. Further reading
  33. Offloading Tasks with Operations and GCD
    1. Writing asynchronous code
      1. Understanding threads
      2. Using dispatch queues in your application
    2. Creating reusable tasks with Operations
      1. Using Operations in your apps
    3. Summary
    4. Questions
    5. Further reading
  34. Submitting Your App to the App Store
    1. Adding your application to App Store Connect
    2. Packaging and uploading your app for beta testing
    3. Preparing your app for launch
    4. Summary
    5. Further reading
  35. Appendix
    1. Chapter 12 
    2. Chapter 13
    3. Chapter 14
    4. Chapter 15
    5. Chapter 16
    6. Chapter 17
    7. Chapter 18
    8. Chapter 19
    9. Chapter 20
    10. Chapter 21
    11. Chapter 22 
    12. Chapter 23
    13. Chapter 24
    14. Chapter 25
    15. Chapter 26
    16. Chapter 27
    17. Chapter 28 
  36. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think
44.221.45.48