IPhone iOS 6 Development Essentials
From Techotopia
© 2012 Neil Smyth / Payload Media. This eBook is provided for personal use only. Unauthorized use, reproduction and/or distribution strictly prohibited. All rights reserved.
Table of Contents
- The Basics of Modern Objective-C
- An Introduction to Auto Layout in iOS 6
- Working with iOS 6 Auto Layout Constraints in Interface Builder
- An iPhone iOS 6 Auto Layout Example
- Implementing iOS 6 Auto Layout Constraints in Code
- Implementing Cross-Hierarchy Auto Layout Constraints in iOS 6
- Understanding the iOS 6 Auto Layout Visual Format Language
- Using Xcode Storyboarding
- Creating the Storyboard Example Project
- Accessing the Storyboard
- Adding Scenes to the Storyboard
- Configuring Storyboard Segues
- Configuring Storyboard Transitions
- Associating a View Controller with a Scene
- Passing Data Between Scenes
- Unwinding Storyboard Segues
- Triggering a Storyboard Segue Programmatically
- Using Xcode Storyboards to create an iOS 6 iPhone Tab Bar Application
- An Overview of the Tab Bar
- Understanding View Controllers in a Multiview Application
- Setting up the Tab Bar Example Application
- Reviewing the Project Files
- Renaming the Initial View Controller
- Adding the View Controller for the Second Content View
- Adding the Tab Bar Controller to the Storyboard
- Adding a Second View Controller to the Storyboard
- Designing the View Controller User interfaces
- Configuring the Tab Bar Items
- Building and Running the Application
- An Overview of iOS 6 Table Views and Xcode Storyboards
- Using Xcode Storyboards to Build Dynamic TableViews with Prototype Table View Cells
- Creating the Example Project
- Adding the TableView Controller to the Storyboard
- Creating the UITableViewController and UITableViewCell Subclasses
- Declaring the Cell Reuse Identifier
- Designing a Storyboard UITableView Prototype Cell
- Modifying the CarTableViewCell Class
- Creating the Table View Datasource
- Downloading and Adding the Image Files
- Compiling and Running the Application
- Implementing TableView Navigation using Xcode Storyboards
- Using an Xcode Storyboard to Create a Static Table View
- Implementing a Page based iOS 6 iPhone Application using UIPageViewController
- An Example iOS 6 iPhone UIPageViewController Application
- Using the UIPickerView and UIDatePicker Components
- An iOS 6 iPhone UIPickerView Example
- Working with Directories on iOS 6
- The Application Documents Directory
- The Objective-C NSFileManager, NSFileHandle and NSData Classes
- Understanding Pathnames in Objective-C
- Obtaining a Reference to the Default NSFileManager Object
- Identifying the Current Working Directory
- Identifying the Documents Directory
- Identifying the Temporary Directory
- Changing Directory
- Creating a New Directory
- Deleting a Directory
- Listing the Contents of a Directory
- Getting the Attributes of a File or Directory
- Working with iPhone Files on iOS 6
- Creating an NSFileManager Instance
- Checking for the Existence of a File
- Comparing the Contents of Two Files
- Checking if a File is Readable/Writable/Executable/Deletable
- Moving/Renaming a File
- Copying a File
- Removing a File
- Creating a Symbolic Link
- Reading and Writing Files with NSFileManager
- Working with Files using the NSFileHandle Class
- Creating an NSFileHandle Object
- NSFileHandle File Offsets and Seeking
- Reading Data from a File
- Writing Data to a File
- Truncating a File
- iOS 6 iPhone Directory Handling and File I/O – A Worked Example
- Preparing an iOS 6 App to use iCloud Storage
- What is iCloud?
- iCloud Data Storage Services
- Preparing an Application to Use iCloud Storage
- Creating an iOS 6 iCloud enabled App ID
- Creating and Installing an iCloud Enabled Provisioning Profile
- Creating an iCloud Entitlements File
- Manually Creating the Entitlements File
- Accessing Multiple Ubiquity Containers
- Ubiquity Container URLs
- Managing Files using the iOS 6 UIDocument Class
- An Overview of the UIDocument Class
- Subclassing the UIDocument Class
- Conflict Resolution and Document States
- The UIDocument Example Application
- Creating a UIDocument Subclass
- Designing the User Interface
- Implementing the Application Data Structure
- Implementing the contentsForType Method
- Implementing the loadFromContents Method
- Loading the Document at App Launch
- Saving Content to the Document
- Testing the Application
- Using iCloud Storage in an iOS 6 iPhone Application
- iCloud Usage Guidelines
- Preparing the iCloudStore Application for iCloud Access
- Configuring the View Controller
- Implementing the viewDidLoad Method
- Implementing the metadataQueryDidFinishGathering: Method
- Implementing the saveDocument Method
- Enabling iCloud Document and Data Storage on an iPhone
- Running the iCloud Application
- Reviewing and Deleting iCloud Based Documents
- Making a Local File Ubiquitous
- Synchronizing iPhone iOS 6 Key-Value Data using iCloud
- An Overview of iCloud Key-Value Data Storage
- Sharing Data Between Applications
- Data Storage Restrictions
- Conflict Resolution
- Receiving Notification of Key-Value Changes
- An iCloud Key-Value Data Storage Example
- Enabling the Application for iCloud Key Value Data Storage
- Designing the User Interface
- Implementing the View Controller
- Modifying the viewDidLoad Method
- Implementing the Notification Method
- Implementing the saveData Method
- Testing the Application
- iOS 6 iPhone Data Persistence using Archiving
- iOS 6 iPhone Database Implementation using SQLite
- What is SQLite?
- Structured Query Language (SQL)
- Trying SQLite on MacOS X
- Preparing an iPhone Application Project for SQLite Integration
- Key SQLite Functions
- Declaring a SQLite Database
- Opening or Creating a Database
- Preparing and Executing a SQL Statement
- Creating a Database Table
- Extracting Data from a Database Table
- Closing a SQLite Database
- An Example SQLite based iOS 6 iPhone Application
- About the Example SQLite iPhone Application
- Creating and Preparing the SQLite Application Project
- Importing sqlite3.h and declaring the Database Reference
- Designing the User Interface
- Creating the Database and Table
- Implementing the Code to Save Data to the SQLite Database
- Implementing Code to Extract Data from the SQLite Database
- Building and Running the Application
- Working with iOS 6 iPhone Databases using Core Data
- The Core Data Stack
- Managed Objects
- Managed Object Context
- Managed Object Model
- Persistent Store Coordinator
- Persistent Object Store
- Defining an Entity Description
- Obtaining the Managed Object Context
- Getting an Entity Description
- Creating a Managed Object
- Getting and Setting the Attributes of a Managed Object
- Fetching Managed Objects
- Retrieving Managed Objects based on Criteria
- An iOS 6 iPhone Core Data Tutorial
- The iPhone Core Data Example Application
- Creating a Core Data based iPhone Application
- Creating the Entity Description
- Adding a View Controller
- Designing the User Interface
- Saving Data to the Persistent Store using Core Data
- Retrieving Data from the Persistent Store using Core Data
- Building and Running the Example Application
- Summary
- An Overview of iOS 6 iPhone Multitouch, Taps and Gestures
- An Example iOS 6 iPhone Touch, Multitouch and Tap Application
- An Overview of iOS 6 Collection View and Flow Layout
- An Overview of Collection Views
- The UICollectionView Class
- The UICollectionViewCell Class
- The UICollectionReusableView Class
- The UICollectionViewFlowLayout Class
- The UICollectionViewLayoutAttributes Class
- The UICollectionViewDataSource Protocol
- The UICollectionViewDelegate Protocol
- The UICollectionViewDelegateFlowLayout Protocol
- Cell and View Reuse
- An iPhone iOS 6 Storyboard-based Collection View Tutorial
- Creating the Collection View Example Project
- Removing the Template View Controller
- Adding a Collection View Controller to the Storyboard
- Adding the Collection View Cell Class to the Project
- Designing the Cell Prototype
- Implementing the Data Model
- Implementing the Data Source
- Testing the Application
- Setting Sizes for Cell Items
- Changing Scroll Direction
- Implementing a Supplementary View
- Implementing the Supplementary View Protocol Methods
- Deleting Collection View Items
- Subclassing and Extending the iOS 6 Collection View Flow Layout
- About the Example Layout Class
- Subclassing the UICollectionViewFlowLayout Class
- Extending the New Layout Class
- Implementing the layoutAttributesForItemAtIndexPath: Method
- Implementing the layoutAttributesForElementsInRect: Method
- Implementing the modifyLayoutAttributes: Method
- Adding the New Layout and Pinch Gesture Recognizer
- Implementing the Pinch Recognizer
- Avoiding Image Clipping
- Adding the QuartzCore Framework to the Project
- Testing the Application
- Drawing iOS 6 iPhone 2D Graphics with Quartz
- An iOS 6 iPhone Graphics Tutorial using Quartz 2D and Core Image
- The iOS iPhone Drawing Example Application
- Creating the New Project
- Creating the UIView Subclass
- Locating the drawRect Method in the UIView Subclass
- Drawing a Line
- Drawing Paths
- Drawing a Rectangle
- Drawing an Ellipse or Circle
- Filling a Path with a Color
- Drawing an Arc
- Drawing a Cubic Bézier Curve
- Drawing a Quadratic Bézier Curve
- Dashed Line Drawing
- Drawing an Image into a Graphics Context
- Image Filtering with the Core Image Framework
- Basic iOS 6 iPhone Animation using Core Animation
- UIView Core Animation Blocks
- Understanding Animation Curves
- Receiving Notification of Animation Completion
- Performing Affine Transformations
- Combining Transformations
- Creating the Animation Example Application
- Implementing the Interface File
- Drawing in the UIView
- Detecting Screen Touches and Performing the Animation
- Building and Running the Animation Application
- Integrating iAds into an iOS 6 iPhone App
- iOS iPhone Advertising Options
- iAds Advertisement Formats
- Basic Rules for the Display of iAds
- Creating an Example iAds iPhone Application
- Adding the iAds Framework to the Xcode Project
- Configuring the View Controller
- Designing the User Interface
- Creating the Banner Ad
- Displaying the Ad
- Implementing the Delegate Methods
- An Overview of iOS 6 iPhone Multitasking
- Scheduling iOS 6 iPhone Local Notifications
- An Overview of iOS 6 Application State Preservation and Restoration
- An iOS 6 iPhone State Preservation and Restoration Tutorial
- Creating the Example Application
- Trying the Application without State Preservation
- Opting-in to State Preservation
- Setting Restoration Identifiers
- Encoding and Decoding View Controller State
- Adding a Navigation Controller to the Storyboard
- Adding the Third View Controller
- Creating the Restoration Class
- Integrating Maps into iPhone iOS 6 Applications using MKMapItem
- An Example iOS 6 iPhone MKMapItem Application
- Getting iPhone Location Information using the iOS 6 Core Location Framework
- An Example iOS 6 iPhone Location Application
- Working with Apple Maps on the iPhone with MapKit and the MKMapView Class
- About the MapKit Framework
- Understanding Map Regions
- About the iPhone MKMapView Tutorial
- Creating the iPhone Map Tutorial
- Adding the MapKit Framework to the Xcode Project
- Creating the MKMapView Instance and Toolbar
- Configuring the Map View
- Changing the MapView Region
- Changing the Map Type
- Testing the iPhone MapView Application
- Updating the Map View based on User Movement
- Adding Basic Annotations to a Map View
- Using iOS 6 Event Kit to Create Date and Location Based Reminders
- An Overview of the Event Kit Framework
- The EKEventStore Class
- Accessing Calendars in the Database
- Accessing Current Reminders
- Creating Reminders
- Creating Alarms
- Creating the Example Project
- Designing the User Interface for the Date/Time Based Reminder Screen
- Implementing the Reminder Code
- Hiding the Keyboard
- Designing Location-based Reminder Screen
- Creating a Location-based Reminder
- Adding the Core Location and Event Kit Frameworks
- Testing the Application
- Accessing the iPhone Camera and Photo Library
- An Example iOS 6 iPhone Camera Application
- Video Playback from within an iOS 6 iPhone Application
- An Overview of the MPMoviePlayerController Class
- Supported Video Formats
- The iPhone Movie Player Example Application
- Adding the MediaPlayer Framework to the Project
- Designing the User Interface
- Declaring the MoviePlayer Instance
- Implementing the Action Method
- The Target-Action Notification Method
- Build and Run the Application
- Playing Audio on an iPhone using AVAudioPlayer
- Supported Audio Formats
- Receiving Playback Notifications
- Controlling and Monitoring Playback
- Creating the iPhone Audio Example Application
- Adding the AVFoundation Framework
- Adding an Audio File to the Project Resources
- Designing the User Interface
- Implementing the Action Methods
- Creating and Initializing the AVAudioPlayer Object
- Implementing the AVAudioPlayerDelegate Protocol Methods
- Building and Running the Application
- Recording Audio on an iPhone with AVAudioRecorder
- Integrating Twitter and Facebook into iPhone iOS 6 Applications
- An iPhone iOS 6 Facebook Integration Tutorial using UIActivityViewController
- iPhone iOS 6 Facebook and Twitter Integration using SLRequest
- An iOS 6 iPhone Twitter Integration Tutorial using SLRequest
- Making Store Purchases with the SKStoreProductViewController Class
- Building In-App Purchasing into iPhone iOS 6 Applications
- Preparing an iOS 6 Application for In-App Purchases
- An iPhone iOS 6 In-App Purchase Tutorial
- Configuring and Creating App Store Hosted Content for iOS 6 In-App Purchases