Home Page Icon
Home Page
Table of Contents for
Mastering iOS 10 Programming
Close
Mastering iOS 10 Programming
by Donny Wals
Mastering iOS 10 Programming
Mastering iOS 10 Programming
Mastering iOS 10 Programming
Credits
About the Author
About the Reviewer
www.PacktPub.com
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. UITableView Touch Up
Setting up the User Interface (UI)
Fetching a user's contacts
Creating a custom UITableViewCell for our contacts
Designing the contact cell
Creating the cell subclass
Displaying the list of contacts
Protocols and delegation
Conforming to the UITableViewDataSource and UITableViewDelegate protocol
Under the hood of UITableView performance
Improving performance with prefetching in iOS 10
UITableViewDelegate and interactions
Responding to cell selection
Implementing cell deletion
Allowing the user to reorder cells
Summary
2. A Better Layout with UICollectionView
Converting from a UITableView to UICollectionView
Creating and implementing a custom UICollectionViewCell
Understanding the UICollectionViewFlowLayout and its delegate
Creating a custom UICollectionViewLayout
Pre-calculating the layout
Implementing collectionViewContentSize
Implementing layoutAttributesForElements(_:)
Implementing layoutAttributesForItem(_:)
Implementing shouldInvalidateLayout(_:)
Assigning the custom layout to the collection view
Final words on the custom layout
UICollectionView performance
User interactions with UICollectionView
Cell selection
Cell deletion
Cell reordering
Refactoring the long press handler
Implementing the reorder method calls
Implementing the data source methods
Adding the edit button
Summary
3. Creating a Contact Detail Page
Universal applications
Implementing navigation with segues
Creating adaptive layouts with Auto Layout
Auto Layout with the Interface Builder
Adding a scroll view to make the layout scrollable
Laying out the image and name label
Adjusting the image and name label for large screens
Laying out the bottom section
Adjust the bottom section for small screens
Auto Layout in code
Implementing the compact size layout
Implementing the regular size layout
Easier layouts with UIStackView
Containing labels in a UIStackView
Varying columns and layouts for traits in UIStackView
Passing data between view controllers
Updating the data loading and model
Passing the model to the detail page
Implementing new outlets and display data
Summary
4. Immersing Your Users With Animation
UIView animation basics
Using the UIView.animate method for animation
Exploring UIView's animation options
Adding vibrancy to animations with springs
Taking control of animations with UIViewPropertyAnimator
Customizing view controller transitions
Implementing a custom modal presentation transition
Making an interactive dismissal transition
Implementing a custom UINavigationController transition
Summary
5. Improving Your Code with Value Types
Understanding reference types
Understanding value types
Differences between values and references in usage
Memory differences between values and references
Heap allocation
Stack allocation
Using structs to improve your code
Starting your models as structs
Using a struct if you don't need inheritance
Enforcing immutability with structs
Final words on structs
Containing information in enums
Summary
6. Avoiding Complex Inheritance with Protocols
Defining your own protocols
Checking for traits instead of types
Extending your protocols with default behavior
Improving your protocols with associated types
Summary
7. Refactoring the HelloContacts Application
Properly separating concerns
Extracting the contact fetching code
Extracting the bounce animation
Adding protocols for clarity
Defining the view effect animator protocol
Defining a contact display protocol
Summary
8. Adding Core Data to your App
Understanding the Core Data stack
Adding Core Data to an application
Modeling data in the model editor
Creating the basic models
Defining relationships
Creating NSManagedObject subclasses
Summary
9. Storing and Querying Data in Core Data
Inserting data with Core Data
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 an NSFetchedResultsController
Summary
10. Fetching and Displaying Data from the Network
Fetching data from the Web
Understanding the 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
11. 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 capabilities
Asking iOS to wake our app up
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
12. Enriching Apps with the Camera, Motion and Location
Accessing and using the camera, the simple way
Exploring the AVFoundation framework
Playing audio with AVFoundation
Playing video with AVFoundation
Rendering the camera feed
Understanding the building blocks of a video feed
Implementing the video feed
Implementing CoreMotion
Tracking walks with the pedometer
Reading sensor data with CoreMotion
Creating the login interface
Using CoreLocation to locate your users
Obtaining a user's location
Providing location based updates with geofencing
Tracking the user's location while they're on the move
Finishing the ArtApp login screen
Summary
13. Displaying Contents of your App in Spotlight
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 rating
Adding metadata to your web links
Registering as an indexing delegate
Summary
14. Making the Web and your App Meet through Universal Links
Understanding Universal Links
Preparing your server for Universal Links
Implementing Smart App Banners
Handling Universal Links in your app
Helping your users to log in seamlessly
Summary
15. Instant Information with a Notification Center Widget
Understanding the anatomy of a Today Extension
Understanding app extensions
Understanding Today Extensions
Adding a Today Extension to your app
Discovering your widget in iOS 10
Sharing data with App Groups
Summary
16. Implementing Rich Notifications
Gaining a deep understanding of notifications
Scheduling and handling notifications
Registering for notifications
Creating notification content
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 Notification Extensions
Adding a Service Extension to your app
Adding a content extension to your app
Summary
17. 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 lifecycle
Implementing the custom compact view
Implementing the expanded view
Understanding sessions, messages, and conversations
Composing a message
Sending a message
Summary
18. Integrating Your App with Siri
Understanding intents and vocabularies
Adding intents to your extension
Adding vocabularies to your app
Adding vocabularies through a .plist file
Teaching Siri 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
Summary
19. Ensuring App Quality with Tests
Testing logic with XCTest
Understanding what it means to test code
Determining what to test
Choosing the correct test type
Unit tests
Integration tests
Isolating tests
Arrange
Act
Assert
Setting up a test suite with XCTest
Optimizing code for testability
Introducing the question loader
Mocking API responses
Using models for consistency
Gaining insights through Code Coverage
Testing the user interface with XCUITest
Making your app accessible to your tests
Recording UI tests
Passing launch arguments to your app
Making sure the UI updates as expected
Summary
20. 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
Summary
21. 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
22. Wrapping Up the Development Cycle and Submitting to the App Store
Adding your application to iTunes Connect
Packaging and uploading your app for beta testing
Preparing your app for launch
Summary
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Table of Contents
Next
Next Chapter
Mastering iOS 10 Programming
Mastering iOS 10 Programming
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset