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