Book description
Entirely rewritten for Apple’s Swift programming language, this updated cookbook helps you overcome the vexing issues you’re likely to face when creating apps for iOS devices. You’ll find hundreds of new and revised recipes for using the iOS 8 SDK, including techniques for working with Health data and HomeKit accessories, enhancing and animating graphics, storing and protecting data, sending and receiving notifications, and managing files and folders among them. Each recipe includes sample code on GitHub that you can use right away.
Table of contents
- Preface
-
1. The Basics
- 1.0. Introduction
- 1.1. Adding Blur Effects to Your Views
- 1.2. Presenting Temporary Information on the Screen with Popovers
- 1.3. Displaying Images with UIImageView
- 1.4. Displaying Static Text with UILabel
- 1.5. Adding Buttons to the User Interface with UIButton
- 1.6. Displaying Alerts and Action Sheets
- 1.7. Creating, Using, and Customizing Switches with UISwitch
- 1.8. Picking Values with the UIPickerView
- 1.9. Picking the Date and Time with UIDatePicker
- 1.10. Implementing Range Pickers with UISlider
- 1.11. Grouping Compact Options with UISegmentedControl
- 1.12. Presenting Sharing Options with UIActivityViewController
- 1.13. Presenting Custom Sharing Options with UIActivityViewController
- 1.14. Displaying an Image on a Navigation Bar
- 1.15. Adding Buttons to Navigation Bars Using UIBarButtonItem
- 1.16. Accepting User Text Input with UITextField
- 1.17. Displaying Long Lines of Text with UITextView
- 1.18. Creating Scrollable Content with UIScrollView
- 1.19. Loading Web Pages with WebKit
- 1.20. Loading Web Pages with UIWebView
- 1.21. Displaying Progress with UIProgressView
- 1.22. Creating a Provision Profile
- 2. Extensions
-
3. Managing Health Data with HealthKit
- 3.0. Introduction
- 3.1. Setting Up Your App for HealthKit
- 3.2. Retrieving and Modifying the User’s Weight Information
- 3.3. Accessing and Modifying the User’s Height Information
- 3.4. Retrieving User Characteristics
- 3.5. Observing Changes to the User’s Health Information
- 3.6. Reading and Modifying the User’s Total Calories Burned
- 3.7. Converting Between Units
-
4. Managing Home Appliances with HomeKit
- 4.0. Introduction
- 4.1. Simulating HomeKit Accessories
- 4.2. Managing the User’s Home in HomeKit
- 4.3. Adding Rooms to the User’s Home
- 4.4. Specifying Zones in the User’s Home
- 4.5. Discovering and Managing HomeKit Enabled Accessories
- 4.6. Interacting with HomeKit Accessories
- 4.7. Grouping Services of HomeKit Accessories
-
5. Creating Dynamic and Interactive User Interfaces
- 5.0. Introduction
- 5.1. Adding Gravity to Your UI Components
- 5.2. Detecting and Reacting to Collisions Between UI Components
- 5.3. Animating Your UI Components with a Push
- 5.4. Attaching Multiple Dynamic Items to Each Other
- 5.5. Adding a Dynamic Snap Effect to Your UI Components
- 5.6. Assigning Characteristics to Your Dynamic Effects
-
6. Table and Collection Views
- 6.0. Introduction
- 6.1. Populating a Table View with Data
- 6.2. Enabling Swipe Deletion of Table View Cells
- 6.3. Constructing Headers and Footers in Table Views
- 6.4. Displaying a Refresh Control for Table Views
- 6.5. Providing Basic Content to a Collection View
- 6.6. Feeding Custom Cells to Collection Views Using .xib Files
- 6.7. Handling Events in Collection Views
- 6.8. Providing Header and Footer in a Collection View
- 6.9. Adding Custom Interactions to Collection Views
-
7. Concurrency and Multitasking
- 7.0. Introduction
- 7.1. Performing UI-Related Tasks
- 7.2. Performing Non-UI Related Tasks
- 7.3. Performing Tasks After a Delay
- 7.4. Performing a Task Only Once
- 7.5. Grouping Tasks Together
- 7.6. Creating Simple Concurrency with Operations
- 7.7. Creating Dependency Between Operations
- 7.8. Firing Periodic Tasks
- 7.9. Completing a Long-Running Task in the Background
- 7.10. Adding Background Fetch Capabilities to Your Apps
- 7.11. Playing Audio in the Background
- 7.12. Handling Location Changes in the Background
- 7.13. Handling Network Connections in the Background
-
8. Security
- 8.0. Introduction
- 8.1. Authenticating the User with Touch ID
- 8.2. Enabling Security and Protection for Your Apps
- 8.3. Storing Values in the Keychain
- 8.4. Finding Values in the Keychain
- 8.5. Updating Existing Values in the Keychain
- 8.6. Deleting Existing Values in the Keychain
- 8.7. Sharing Keychain Data Between Multiple Apps
- 8.8. Writing to and Reading Keychain Data from iCloud
- 8.9. Storing Files Securely in the App Sandbox
- 8.10. Securing Your User Interface
-
9. Core Location, iBeacon, and Maps
- 9.0. Introduction
- 9.1. Detecting Which Floor the User Is on in a Building
- 9.2. Defining and Processing iBeacons
- 9.3. Pinpointing the Location of a Device
- 9.4. Displaying Pins on a Map View
- 9.5. Displaying Custom Pins on a Map View
- 9.6. Searching on a Map View
- 9.7. Displaying Directions on the Map
- 9.8. Customizing the View of the Map with a Camera
- 10. Gesture Recognizers
-
11. Networking and Sharing
- 11.0. Introduction
- 11.1. Downloading Data Using NSURLSession
- 11.2. Downloading Data in the Background Using NSURLSession
- 11.3. Uploading Data Using NSURLSession
- 11.4. Downloading Asynchronously with NSURLConnection
- 11.5. Handling Timeouts in Asynchronous Connections
- 11.6. Downloading Synchronously with NSURLConnection
- 11.7. Customizing URL Requests
- 11.8. Sending HTTP Requests with NSURLConnection
- 11.9. Serializing and Deserializing JSON Objects
- 11.10. Integrating Social Sharing into Your Apps
- 12. Multimedia
-
13. Address Book
- 13.0. Introduction
- 13.1. Retrieving a Person Entity with System UI
- 13.2. Retrieving a Property of a Person Entity with System UI
- 13.3. Requesting Access to the Address Book
- 13.4. Retrieving All the People in the Address Book
- 13.5. Retrieving Properties of Address Book Entries
- 13.6. Inserting a Person Entry into the Address Book
- 13.7. Inserting a Group Entry into the Address Book
- 13.8. Adding Persons to Groups
- 13.9. Searching the Address Book
- 13.10. Retrieving and Setting a Person’s Address Book Image
- 14. Files and Folder Management
-
15. Camera and the Photo Library
- 15.0. Introduction
- 15.1. Detecting and Probing the Camera
- 15.2. Taking Photos with the Camera
- 15.3. Taking Videos with the Camera
- 15.4. Storing Photos in the Photo Library
- 15.5. Storing Videos in the Photo Library
- 15.6. Searching for and Retrieving Images and Videos
- 15.7. Reacting to Changes in Images and Videos
- 15.8. Editing Images and Videos Right on the Device
-
16. Notifications
- 16.0. Introduction
- 16.1. Sending Notifications
- 16.2. Listening for and Reacting to Notifications
- 16.3. Listening and Reacting to Keyboard Notifications
- 16.4. Scheduling Local Notifications
- 16.5. Listening for and Reacting to Local Notifications
- 16.6. Handling Local System Notifications
- 16.7. Setting Up Your App for Push Notifications
- 16.8. Delivering Push Notifications to Your App
- 16.9. Reacting to Push Notifications
-
17. Core Data
- 17.0. Introduction
- 17.1. Performing Batch Updates on Core Data
- 17.2. Writing to Core Data
- 17.3. Reading Data from Core Data
- 17.4. Deleting Data from Core Data
- 17.5. Sorting Data in Core Data
- 17.6. Boosting Data Access in Table Views
- 17.7. Implementing Relationships in Core Data
- 17.8. Fetching Data in the Background
- 17.9. Using Custom Data Types in Your Core Data Model
-
18. Dates, Calendars, and Events
- 18.0. Introduction
- 18.1. Constructing Date Objects
- 18.2. Retrieving Date Components
- 18.3. Requesting Permission to Access Calendars
- 18.4. Retrieving Calendar Groups on an iOS Device
- 18.5. Adding Events to Calendars
- 18.6. Accessing the Contents of Calendars
- 18.7. Removing Events from Calendars
- 18.8. Adding Recurring Events to Calendars
- 18.9. Retrieving the Attendees of an Event
- 18.10. Adding Alarms to Calendars
- 19. Graphics and Animations
- 20. Core Motion
-
21. Cloud
- 21.0. Introduction
- 21.1. Setting Up Your App for CloudKit
- 21.2. Storing Data with CloudKit
- 21.3. Retrieving Data with CloudKit
- 21.4. Querying the Cloud with CloudKit
- 21.5. Observing Changes to Records in CloudKit
- 21.6. Retrieving User Information from CloudKit
- 21.7. Storing and Synchronizing Dictionaries in iCloud
- 21.8. Creating and Managing Files and Folders in iCloud
- 21.9. Searching for Files and Folders in iCloud
- Index
- Colophon
- Copyright
Product information
- Title: iOS 8 Swift Programming Cookbook
- Author(s):
- Release date: November 2014
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781491908693
You might also like
book
iOS 10 Swift Programming Cookbook
Ready to build truly stunning apps for iPhone, iPad, and Apple Watch? This cookbook—written exclusively in …
book
iOS 11 Swift Programming Cookbook
iOS 11, Swift 4, and Xcode 9 provide many new APIs for iOS developers. With this …
book
iOS 4 Programming Cookbook
You can build a variety of amazing apps on the iOS platform—and every one of them …
video
Learning App Development in iOS 8
In this Learning App Development in iOS 8 training course, expert author Keith Welch will teach …