You are previewing iOS® 8 for Programmers: An App-Driven Approach with Swift™, Third Edition.
O'Reilly logo
iOS® 8 for Programmers: An App-Driven Approach with Swift™, Third Edition

Book Description

The professional programmer’s Deitel® guide to iPhone® and iPad® app development using iOS® 8, Swift™, Xcode® 6, and Cocoa Touch®

Billions of apps have been downloaded from Apple’s App Store! This book gives you everything you’ll need to start developing great iOS 8 apps quickly using Swift–Apple’s programming language of the future. You’ll also learn what makes a great app and how to publish your apps in the App Store. The book uses an app-driven approach–each new technology is discussed in the context of seven fully tested iOS 8 apps, complete with syntax shading, code highlighting, code walkthroughs and sample outputs. Apps you’ll develop include:

  • Welcome App

  • Cannon Game

  • Tip Calculator

  • Doodlz

  • Twitter® Searches

  • Address Book

  • Flag Quiz

  • Practical, Example-Rich Coverage of:

  • iOS® 8, XCode® 6, Swift

  • Object-Oriented Programming with Swift and Cocoa Touch®

  • UI Design, Storyboards, Auto Layout, Outlets, Outlet Collections, Actions

  • View Controllers, Views, View Animations

  • Event Handling, Multi-Touch

  • Single View, Master-Detail, Game Templates

  • Accessibility, Internationalization

  • Core Data Database Access

  • User Defaults, iCloud Key—Value Storage

  • Social Framework Sharing

  • SpriteKit Game Programming: Animation, Graphics, Physics, Collision Detection

  • Accelerometer and Motion Event Handling

  • Grand Central Dispatch

  • App Store, Pricing, Monetization and more.

  • Be sure to read the companion book: Swift for Programmers, also available in the Safari reference library.

    Visit www.deitel.com

  • Download code examples

  • For information on Deitel’s Dive Into® Series programming training courses delivered at organizations worldwide visit www.deitel.com/training or write to deitel@deitel.com

  • Join the Deitel social networking communities on Facebook® at facebook.com/DeitelFan, Twitter® at @deitel, Google+ at google.com/+DeitelFan, LinkedIn® at bit.ly/DeitelLinkedIn, YouTube™ at youtube.com/user/DeitelTV and subscribe to the Deitel® Buzz Online e-mail newsletter at www.deitel.com/newsletter/subscribe.html

  • About This Book

    Sales of iOS devices and app downloads have been explosive. The first-generation iPhone sold 6.1 million units in its initial five quarters of availability (bit.ly/iPhoneGen1l). The iPhone 6 and iPhone 6 Plus, released in September 2014, sold over 10 million combined in their first weekend of availability (bit.ly/FirstiPhone6Weekend). iPad sales are equally impressive. The first generation iPad, launched in April 2010, sold 3 million units in its first 80 days of availability (bit.ly/iPadGen1). In just the first quarter of 2014, Apple sold a record 26 million iPads (bit.ly/iPad2014Q1). At the time of this writing, there were over 1.2 million apps in the App Store (bit.ly/iOSApps2014) and more than 75 billion apps have been downloaded!

    This book presents leading-edge computing technologies for professional software developers. At the heart of the book is the Deitel “app-driven approach”– a variant of Deitel’s live-code approach–concepts are presented in the context of complete working iOS apps, rather than using code snippets. The introduction and app test drives at the beginning of each chapter show one or more sample executions. The book’s source code is available at: www.deitel.com/books/iOS8FP1.

    You’ll quickly learn everything you need to start building iOS 8 apps–beginning with a test-drive of the Tip Calculator app in Chapter 1, then building your first apps in Chapter 2 with visual programming and in Chapter 3 with Swift. By the time you reach Chapter 9, you’ll be ready to create your own apps for submission to the App Store. We’ll overview the submission process, including uploading your apps, deciding whether to sell your apps or offer them for free, and marketing them using in-app advertising, social media, Internet public relations and more.

    Table of Contents

    1. About This eBook
    2. Title Page
    3. Copyright Page
    4. Deitel® Series Page
      1. Deitel® Developer Series
      2. How To Program Series
      3. Simply Series
      4. CourseSmart Web Books
      5. LiveLessons Video Learning Products
    5. Dedication Page
    6. Contents
    7. Preface
      1. Explosive Growth of the iPhone and iPad Is Creating Opportunity for Developers
      2. SafariBooksOnline e-Book and LiveLessons Videos
      3. Copyright Notice and Code License
      4. Intended Audience
      5. Academic Bundle iOS® 8 for Programmers and Swift™ for Programmers
        1. Ordering the Books and Supplements Separately
        2. Instructor Supplements
      6. Key Features of iOS® 8 for Programmers: An App-Driven Approach with Swift™, Volume 1, 3/e
      7. Features
      8. iOS® 8 for Programmers: An App-Driven Approach with Swift™, Volume 2
      9. iOS® 8 Fundamentals LiveLessons Video Training Products
      10. Acknowledgments
        1. Pearson Education Team
        2. Reviewers
        3. Keeping in Touch with the Authors
      11. About the Authors
      12. About Deitel® & Associates, Inc.
    8. Before You Begin
      1. Font and Naming Conventions
      2. Conventions for Referencing Menu Items in a Menu
      3. Software Used in this Book
        1. A Note Regarding the Xcode 6 Toolbar Icons
      4. Becoming a Registered Apple Developer
      5. Fee-Based Developer Programs
        1. iOS Developer Program
        2. iOS Developer Enterprise Program
        3. iOS Developer University Program
      6. Adding Your Paid iOS Developer Program Account to Xcode
      7. Obtaining the Code Examples
      8. Xcode Projects
      9. Configuring Xcode to Display Line Numbers
      10. Configuring Xcode’s Code Indentation Options
    9. 1. Introduction to iOS 8 App Development and Swift
      1. 1.1 Introduction
        1. App-Driven Approach
      2. 1.2 iPhone and iPad Sales Data
      3. 1.3 Gestures
      4. 1.4 Sensors
      5. 1.5 Accessibility
      6. 1.6 iPhone 6 and iPhone 6 Plus
      7. 1.7 iOS Operating System History and Features
        1. 1.7.1 iPhone Operating System
        2. 1.7.2 iPhone OS 2: Introducing Third-Party Apps and the App Store
        3. 1.7.3 iPhone OS 3
        4. 1.7.4 iOS 4
        5. 1.7.5 iOS 5
        6. 1.7.6 iOS 6
        7. 1.7.7 iOS 7
      8. 1.8 iOS 8
      9. 1.9 Apple Watch
      10. 1.10 App Store
      11. 1.11 Objective-C
      12. 1.12 Swift: Apple’s Programming Language of the Future
        1. 1.12.1 Key Features
        2. 1.12.2 Performance
        3. 1.12.3 Error Prevention
        4. 1.12.4 Swift Standard Library
        5. 1.12.5 Swift Apps and the Cocoa® and Cocoa Touch® Frameworks
        6. 1.12.6 Swift and Objective-C Interoperability
        7. 1.12.7 Other Apple Swift Resources
      13. 1.13 Can I Use Swift Exclusively?
        1. 1.13.1 Objective-C Programmers Who Are Developing New iOS Apps in Swift
        2. 1.13.2 Objective-C Programmers Who Are Enhancing Existing iOS Apps with Swift
        3. 1.13.3 Java, C++ and C# Programmers Who Are New to iOS App Development
        4. 1.13.4 Rapid Evolution Expected
        5. 1.13.5 Mixing Swift and Objective-C Code
      14. 1.14 Cocoa Touch® iOS Frameworks
        1. Foundation Framework
        2. AppKit Framework
        3. UIKit Framework
        4. Other Cocoa Touch Frameworks
        5. Web Services
      15. 1.15 Xcode 6® Integrated Development Environment
        1. The iOS Simulator
      16. 1.16 Object Oriented-Programming Review
        1. 1.16.1 Automobile as an Object
        2. 1.16.2 Methods and Classes
        3. 1.16.3 Instantiation
        4. 1.16.4 Reuse
        5. 1.16.5 Messages and Method Calls
        6. 1.16.6 Attributes and Properties
        7. 1.16.7 Encapsulation and Information Hiding
        8. 1.16.8 Inheritance
        9. 1.16.9 Protocols
        10. 1.16.10 Design Patterns
      17. 1.17 Test-Driving the Tip Calculator App in the iPhone and iPad Simulators
        1. Test-Driving the Completed Application Using the iPhone Simulator
        2. Test-Driving the Completed Application Using the iPad Simulator
        3. Test-Drives for the Book’s Apps
      18. 1.18 What Makes a Great App?
      19. 1.19 iOS Security
        1. Find My iPhone and Remote Wipe
      20. 1.20 iOS Publications and Forums
      21. 1.21 Wrap-Up
    10. 2. Welcome App
      1. 2.1 Introduction
      2. 2.2 Technologies Overview
        1. 2.2.1 Xcode and Interface Builder
        2. 2.2.2 Labels and Image Views
        3. 2.2.3 Asset Catalogs and Image Sets
        4. 2.2.4 Running the App
        5. 2.2.5 Accessibility
        6. 2.2.6 Internationalization
      3. 2.3 Creating a Universal App Project with Xcode
        1. 2.3.1 Launching Xcode
        2. 2.3.2 Projects and App Templates
        3. 2.3.3 Creating and Configuring a Project
      4. 2.4 Xcode Workspace Window
        1. 2.4.1 Navigator Area
        2. 2.4.2 Editor Area
        3. 2.4.3 Utilities Area and Inspectors
        4. 2.4.4 Debug Area
        5. 2.4.5 Xcode Toolbar
        6. 2.4.6 Project Navigator
        7. 2.4.7 Keyboard Shortcuts
      5. 2.5 Storyboarding the Welcome App’s UI
        1. 2.5.1 Configuring the App for Portrait and Landscape Orientations
        2. 2.5.2 Providing an App Icon
        3. 2.5.3 Creating an Image Set for the App’s Image
        4. 2.5.4 Overview of the Storyboard and the Xcode Utilities Area
        5. 2.5.5 Adding an Image View to the UI
        6. 2.5.6 Using Inspectors to Configure the Image View
        7. 2.5.7 Adding and Configuring the Label
        8. 2.5.8 Using Auto Layout to Support Different Screen Sizes and Orientations
      6. 2.6 Running the Welcome App
        1. 2.6.1 Testing on the iOS Simulator
        2. 2.6.2 Testing on a Device (for Paid Apple iOS Developer Program Members Only)
      7. 2.7 Making Your App Accessible
        1. 2.7.1 Enabling Accessibility for the Image View
        2. 2.7.2 Confirming Accessibility Text with the Simulator’s Accessibility Inspector
      8. 2.8 Internationalizing Your App
        1. 2.8.1 Locking Your UI During Translation
        2. 2.8.2 Exporting Your UI’s String Resources
        3. 2.8.3 Translating the String Resources
        4. 2.8.4 Importing the Translated String Resources
        5. 2.8.5 Testing the App in Spanish
      9. 2.9 Wrap-Up
    11. 3. Tip Calculator App
      1. 3.1 Introduction
      2. 3.2 Technologies Overview
        1. 3.2.1 Swift Programming
        2. 3.2.2 Swift Apps and the Cocoa Touch® Frameworks
        3. 3.2.3 Using the UIKit and Foundation Frameworks in Swift Code
        4. 3.2.4 Creating Labels, a Text Field and a Slider with Interface Builder
        5. 3.2.5 View Controllers
        6. 3.2.6 Linking UI Components to Your Swift Code
        7. 3.2.7 Performing Tasks After a View Loads
        8. 3.2.8 Financial Calculations with NSDecimalNumber
        9. 3.2.9 Formatting Numbers as Locale-Specific Currency and Percentage Strings
        10. 3.2.10 Bridging Between Swift and Objective-C Types
        11. 3.2.11 Swift Operator Overloading
        12. 3.2.12 Variable Initialization and Swift Optional Types
        13. 3.2.13 Value Types vs. Reference Types
        14. 3.2.14 Code Completion in the Source-Code Editor
      3. 3.3 Building the App’s UI
        1. 3.3.1 Creating the Project
        2. 3.3.2 Configuring the Size Classes for Designing a Portrait Orientation iPhone App
        3. 3.3.3 Adding the UI Components
        4. 3.3.4 Adding the Auto Layout Constraints
      4. 3.4 Creating Outlets with Interface Builder
        1. Opening the Assistant Editor
        2. Creating an Outlet
        3. Creating the Other Outlets
      5. 3.5 Creating Actions with Interface Builder
        1. Connecting the Slider to Method calculateTip
      6. 3.6 Class ViewController
        1. 3.6.1 import Declarations
        2. 3.6.2 ViewController Class Definition
        3. 3.6.3 ViewController’s @IBOutlet Properties
        4. 3.6.4 Other ViewController Properties
        5. 3.6.5 Overridden UIViewController method viewDidLoad
        6. 3.6.6 ViewController Action Method calculateTip
        7. 3.6.7 Global Utility Functions Defined in ViewController.swift
      7. 3.7 Wrap-Up
    12. 4. Twitter® Searches App
      1. 4.1 Introduction
      2. 4.2 Test-Driving the App
        1. Opening the Completed Application
        2. Running the App
        3. Adding a New Favorite Search
        4. Viewing Twitter Search Results
        5. Editing a Search
        6. Sharing a Search
        7. Deleting a Search and Reordering Searches
        8. Testing the App’s iCloud Capabilities
      3. 4.3 Technologies Overview
        1. 4.3.1 Master-Detail Application Template
        2. 4.3.2 Web View—Displaying Web Content in an App
        3. 4.3.3 Swift: Array and Dictionary Collections
        4. 4.3.4 NSUserDefaults—Local Key–Value Pair Storage for App Settings
        5. 4.3.5 iCloud Key–Value Pair Storage with NSUbiquitousKeyValue-Store
        6. 4.3.6 Social Framework
        7. 4.3.7 Model-View-Controller (MVC) Design Pattern
        8. 4.3.8 Swift: Conforming to Protocols
        9. 4.3.9 Swift: Exposing Methods to Cocoa Touch Libraries
        10. 4.3.10 UIAlertController for Alert Dialogs
        11. 4.3.11 UILongPressGestureRecognizer
        12. 4.3.12 iOS Design Patterns Used in This App
        13. 4.3.13 Swift: External Parameter Names
        14. 4.3.14 Swift: Closures
      4. 4.4 Building the App’s UI
        1. 4.4.1 Creating the Project
        2. 4.4.2 Examining the Default Master-Detail Application
        3. 4.4.3 Configuring the Master and Detail Views
        4. 4.4.4 Creating class Model
      5. 4.5 Class Model
        1. 4.5.1 ModelDelegate Protocol
        2. 4.5.2 Model Properties
        3. 4.5.3 Model Initializer and synchronize Method
        4. 4.5.4 Methods tagAtIndex, queryForTag and queryForTagAt-Index, and Property count
        5. 4.5.5 Method deleteSearchAtIndex
        6. 4.5.6 Method moveTagAtIndex
        7. 4.5.7 Method updateUserDefaults
        8. 4.5.8 Method updateSearches
        9. 4.5.9 Method performUpdates
        10. 4.5.10 Method saveQuery
      6. 4.6 Class MasterViewController
        1. 4.6.1 MasterViewController Properties and modelDataChanged Method
        2. 4.6.2 Method awakeFromNib
        3. 4.6.3 Overridden UIViewController Method viewDidLoad and Method addButtonPressed
        4. 4.6.4 Methods tableViewCellLongPressed and displayLong-PressOptions
        5. 4.6.5 Method displayAddEditSearchAlert
        6. 4.6.6 Method shareSearch
        7. 4.6.7 Overridden UIViewController Method prepareForSegue
        8. 4.6.8 Method urlEncodeString
        9. 4.6.9 UITableViewDataSource Callback Methods
      7. 4.7 Class DetailViewController
        1. 4.7.1 Overridden UIViewController Method viewDidLoad
        2. 4.7.2 Overridden UIViewController Method viewDidAppear
        3. 4.7.3 Overridden UIViewController Method viewWillDisappear
        4. 4.7.4 UIWebViewDelegate Protocol Methods
      8. 4.8 Wrap-Up
    13. 5. Flag Quiz App
      1. 5.1 Introduction
      2. 5.2 Test-Driving the Flag Quiz App
        1. Opening the Completed Application
        2. Running the App
        3. Configuring the Quiz
        4. Taking the Quiz: Making a Correct Selection
        5. Taking the Quiz: Making an Incorrect Selection
        6. Completing the Quiz
      3. 5.3 Technologies Overview
        1. 5.3.1 Designing a Storyboard from Scratch
        2. 5.3.2 UINavigationController
        3. 5.3.3 Storyboard Segues
        4. 5.3.4 UISegmentedControls
        5. 5.3.5 UISwitches
        6. 5.3.6 Outlet Collections
        7. 5.3.7 Using the App’s Main NSBundle to Get a List of Image Filenames
        8. 5.3.8 Using Grand Central Dispatch to Perform a Task in the Future
        9. 5.3.9 Applying an Animation to a UIView
        10. 5.3.10 Darwin Module—Using Predefined C Functions
        11. 5.3.11 Random-Number Generation
        12. 5.3.12 Swift Features Introduced
      4. 5.4 Building the GUI
        1. 5.4.1 Creating the Project
        2. 5.4.2 Designing the Storyboard
        3. 5.4.3 Configuring the View Controller Classes
        4. 5.4.4 Creating the UI for the QuizViewController
        5. 5.4.5 Auto Layout Settings for the QuizViewController UI
        6. 5.4.6 QuizViewController Outlets and Actions
        7. 5.4.7 Creating the UI for the SettingsViewController
        8. 5.4.8 SettingsViewController Outlets and Actions
        9. 5.4.9 Creating Class Model
        10. 5.4.10 Adding the Flag Images to the App
      5. 5.5 Model Class
        1. 5.5.1 ModelDelegate Protocol
        2. 5.5.2 Model Properties
        3. 5.5.3 Model Initializer and regionsChanged Method
        4. 5.5.4 Model Computed Properties
        5. 5.5.5 Model Methods toggleRegion, setNumberOfGuesses and notifyDelegate
        6. 5.5.6 Model Method newQuizCountries
      6. 5.6 QuizViewController Class
        1. 5.6.1 Properties
        2. 5.6.2 Overridden UIViewController Method viewDidLoad, and Methods settingsChanged and resetQuiz
        3. 5.6.3 Methods nextQuestion and countryFromFilename
        4. 5.6.4 Method submitGuess
        5. 5.6.5 Method shakeFlag
        6. 5.6.6 Method displayQuizResults
        7. 5.6.7 Overridden UIViewController Method prepareForSegue
        8. 5.6.8 Array Extension shuffle
      7. 5.7 SettingsViewController Class
        1. 5.7.1 Properties
        2. 5.7.2 Overridden UIViewController Method viewDidLoad
        3. 5.7.3 Event Handlers and Method displayErrorDialog
        4. 5.7.4 Overridden UIViewController Method viewWillDisappear
      8. 5.8 Wrap-Up
    14. 6. Cannon Game App
      1. 6.1 Introduction
      2. 6.2 Test-Driving the Cannon Game App
        1. Opening the Completed Application
        2. Playing the Game
      3. 6.3 Technologies Overview
        1. 6.3.1 Xcode Game Template and SpriteKit
        2. 6.3.2 Adding Sound with the AVFoundation Framework and AVAudioPlayer
        3. 6.3.3 SpriteKit Framework Classes
        4. 6.3.4 SpriteKit Game Loop and Animation Frames
        5. 6.3.5 Physics
        6. 6.3.6 Collision Detection and the SKPhysicsContactDelegate Protocol
        7. 6.3.7 CGGeometry Structures and Functions
        8. 6.3.8 Overriding UIResponder Method touchesBegan
        9. 6.3.9 Game-Element Sizes and Velocities Based on Screen Size
        10. 6.3.10 Swift Features
        11. 6.3.11 NSLocalizedString
      4. 6.4 Creating the Project and Classes
        1. Creating the Project
        2. Landscape Orientation
        3. Hide Status Bar
        4. Add the App Icons to the Asset Catalog
        5. Add the Game’s Sprites (Images) to the Asset Catalog
        6. Adding the Sounds to the App
        7. Add the Game’s Other Classes
      5. 6.5 Class GameViewController
        1. 6.5.1 Overridden UIViewController Method viewDidLoad
        2. 6.5.2 Why Are the AVAudioPlayer Variables Global?
        3. 6.5.3 Autogenerated Methods That We Deleted from Class GameViewController
      6. 6.6 Class Blocker
        1. 6.6.1 BlockerSize enum and Class Blocker’s Properties
        2. 6.6.2 Blocker Initializers
        3. 6.6.3 Methods startMoving, playHitSound and blockerTimePenalty
      7. 6.7 Class Target
        1. 6.7.1 TargetSize and TargetColor enums
        2. 6.7.2 Class Target Properties
        3. 6.7.3 Target Initializers
        4. 6.7.4 Methods startMoving, playHitSound and targetTimeBonus
      8. 6.8 Class Cannon
        1. 6.8.1 Cannon Properties
        2. 6.8.2 Cannon Initializers
        3. 6.8.3 Method rotateToPointAndFire
        4. 6.8.4 Methods fireCannonball and createCannonball
      9. 6.9 Class GameScene
        1. 6.9.1 CollisionCategory struct
        2. 6.9.2 GameScene Class Definition and Properties
        3. 6.9.3 Overridden SKScene Method didMoveToView
        4. 6.9.4 Method createLabels
        5. 6.9.5 SKPhysicsContactDelegate Method didBeginContact and Supporting Methods
        6. 6.9.6 Overridden UIResponder Method touchesBegan
        7. 6.9.7 Overridden SKScene Method update and Method gameOver
      10. 6.10 Class GameOverScene
        1. Initializer
        2. Initializer
        3. Overridden Method touchesBegan
      11. 6.11 Programmatic Internationalization
        1. Localizing Strings in Code with NSLocalizedString
        2. Exporting the String Resources
        3. Translating the String Resources
        4. Importing the Translated String Resources
        5. Testing the App in Spanish
      12. 6.12 Wrap-Up
    15. 7. Doodlz App
      1. 7.1 Introduction
      2. 7.2 Test-Driving the Doodlz App
        1. Opening the Completed Application
        2. Understanding the App’s Options
        3. Changing the Drawing Color to Red
        4. Changing the Stroke Width
        5. Drawing the Flower Petals
        6. Changing the Brush Color to Dark Green
        7. Changing the Stroke Width and Drawing the Stem and Leaves
        8. Changing the Brush Color to a Semitransparent Blue
        9. Actions You Can Perform with Your Image
        10. Saving and Printing APIs
        11. Shake to Erase
        12. Simulating Multi-Touch
      3. 7.3 Technologies Overview
        1. 7.3.1 Drawing with UIView Subclasses, Method drawRect, UIBezierPaths and the UIKit Graphics System
        2. 7.3.2 Processing Multiple Touch Events
        3. 7.3.3 Listening for Motion Events
        4. 7.3.4 Rendering the Drawing as a UIImage
        5. 7.3.5 Storyboard Loading Initialization
      4. 7.4 Building the App’s UI and Adding Its Custom Classes
        1. 7.4.1 Creating the Project
        2. 7.4.2 Creating the Initial View Controller’s User Interface
        3. 7.4.3 Creating the Color View Controller’s User Interface
        4. 7.4.4 Creating the Stroke View Controller’s User Interface
        5. 7.4.5 Adding the Squiggle Class
      5. 7.5 ViewController Class
        1. 7.5.1 ViewController Class Definition, Property and Delegate Methods
        2. 7.5.2 Overridden UIViewController Method prepareForSeque
        3. 7.5.3 ViewController Methods undoButtonPressed, clearButtonPressed and displayEraseDialog
        4. 7.5.4 Overridden UIResponder Method motionEnded
        5. 7.5.5 ViewController Method actionButtonPressed
      6. 7.6 Squiggle Class
        1. Overridden UIBezierPath Method stroke
      7. 7.7 DoodleView Class
        1. 7.7.1 DoodleView Properties
        2. 7.7.2 DoodleView Initializer
        3. 7.7.3 DoodleView Methods undo and clear
        4. 7.7.4 Overridden UIView Method drawRect
        5. 7.7.5 Overridden UIResponder Methods for Touch Handling
        6. 7.7.6 DoodleView Computed Property image
      8. 7.8 ColorViewController Class
        1. 7.8.1 ColorViewControllerDelegate Protocol and the Beginning of Class ColorViewController
        2. 7.8.2 Overridden UIViewController Method viewDidLoad
        3. 7.8.3 ColorViewController Methods colorChanged and done
      9. 7.9 StrokeViewController Class
        1. 7.9.1 SampleLineView Subclass of UIView
        2. 7.9.2 StrokeViewControllerDelegate Protocol and the Beginning of Class StrokeViewController
        3. 7.9.3 Overridden UIViewController Method viewDidLoad
        4. 7.9.4 StrokeViewController Methods lineWidthChanged and done
      10. 7.10 Wrap-Up
    16. 8. Address Book App
      1. 8.1 Introduction
      2. 8.2 Test-Driving the Address Book App
        1. Opening the Completed Application
        2. Adding a Contact
        3. Viewing a Contact
        4. Editing a Contact
        5. Deleting a Contact
      3. 8.3 Technologies Overview
        1. 8.3.1 Enabling Core Data Support
        2. 8.3.2 Data Model and Xcode’s Data Model Editor
        3. 8.3.3 Core Data Framework Classes and Protocols
        4. 8.3.4 UITableViewController Cell Styles
        5. 8.3.5 UITableViewController with Static Cells
        6. 8.3.6 Listening for Keyboard Show and Hide Notifications
        7. 8.3.7 Programmatically Scrolling a UITableView
        8. 8.3.8 UITextFieldDelegate Methods
      4. 8.4 Creating the Project and Configuring the Data Model
        1. 8.4.1 Creating the Project
        2. 8.4.2 Editing the Data Model
        3. 8.4.3 Generating the Contact Subclass of NSManagedObject
      5. 8.5 Building the GUI
        1. 8.5.1 Customizing the MasterViewController
        2. 8.5.2 Customizing the DetailViewController
        3. 8.5.3 Adding the AddEditViewController
        4. 8.5.4 Adding the InstructionsViewController
      6. 8.6 MasterViewController Class
        1. 8.6.1 MasterViewController Class, Properties and awakeFromNib Method
        2. 8.6.2 Overridden UIViewController Method viewWillAppear and Method displayFirstContactOrInstructions
        3. 8.6.3 Overridden UIViewController Method viewDidLoad
        4. 8.6.4 Overridden UIViewController Method prepareForSegue
        5. 8.6.5 AddEditTableViewControllerDelegate Method didSaveContact
        6. 8.6.6 DetailViewControllerDelegate Method didEditContact
        7. 8.6.7 Method displayError
        8. 8.6.8 UITableViewDelegate Methods
        9. 8.6.9 Autogenerated NSFetchedResultsController and NSFetchedResultsControllerDelegate Methods
      7. 8.7 DetailViewController Class
        1. 8.7.1 DetailViewControllerDelegate Protocol
        2. 8.7.2 DetailViewController Properties
        3. 8.7.3 Overridden UIViewController Method viewDidLoad and Method displayContact
        4. 8.7.4 AddEditTableViewControllerDelegate Method didSaveContact
        5. 8.7.5 Overridden UIViewController Method prepareForSegue
      8. 8.8 AddEditTableViewController Class
        1. 8.8.1 AddEditTableViewControllerDelegate Protocol
        2. 8.8.2 AddEditTableViewController Properties
        3. 8.8.3 Overridden UIViewController Methods viewWillAppear and viewWillDisappear
        4. 8.8.4 Overridden UIViewController Method viewDidLoad
        5. 8.8.5 Methods keyboardWillShow and keyboardWillHide
        6. 8.8.6 UITextFieldDelegate Method textFieldShouldReturn
        7. 8.8.7 @IBAction saveButtonPressed
      9. 8.9 AppDelegate Class
        1. 8.9.1 UIApplicationDelegate Protocol Method application: didFinishLaunchingWithOptions:
        2. 8.9.2 UISplitViewControllerDelegate Protocol Method
        3. 8.9.3 Properties and Methods That Support the App’s Core Data Capabilities
      10. 8.10 Wrap-Up
    17. 9. App Store and App Business Issues
      1. 9.1 Introduction
      2. 9.2 iOS Developer Program: Setting Up Your Profile for Testing and Submitting Apps
        1. 9.2.1 Setting Up Your Development Team
        2. 9.2.2 Provisioning a Device for App Testing
        3. 9.2.3 TestFlight Beta Testing
        4. 9.2.4 Creating Explicit App IDs
      3. 9.3 iOS Human Interface Guidelines
      4. 9.4 Preparing Your App for Submission through iTunes Connect
        1. Keywords
        2. Icons
        3. Launch Images
        4. Screenshot(s)
        5. App Previews
        6. Contract Information
        7. Additional Languages (Optional)
      5. 9.5 Pricing Your App: Fee or Free
        1. 9.5.1 Paid Apps
        2. 9.5.2 Free Apps
      6. 9.6 Monetizing Apps
        1. 9.6.1 Using In-App Purchase to Sell Virtual Goods
        2. 9.6.2 iAd In-App Advertising
        3. 9.6.3 App Bundles
        4. 9.6.4 Developing Custom Apps for Organizations
      7. 9.7 Managing Your Apps with iTunes Connect
        1. Crash Reporting
      8. 9.8 Information You’ll Need for iTunes Connect
        1. App Ratings
        2. Pricing
        3. Screenshots of Your App in Action
        4. App Bundle ID
      9. 9.9 iTunes Connect Developer Guide: Steps for Submitting Your App to Apple
        1. Logging into iTunes Connect
        2. iTunes Connect Developer Guide Overview
      10. 9.10 Marketing Your App
        1. Facebook
        2. Twitter
        3. Viral Video
        4. E-Mail Newsletters
        5. App Reviews
        6. Internet Public Relations
        7. Mobile Advertising Networks
      11. 9.11 Other Popular Mobile App Platforms
      12. 9.12 Tools for Multiple-Platform App Development
      13. 9.13 Wrap-Up
        1. Staying in Contact with Deitel & Associates, Inc.
    18. Index
    19. Code Snippets