IOS 9 App Development Essentials
From Techotopia
Table of Contents
- Start Here
- Joining the Apple Developer Program
- Installing Xcode 7 and the iOS 9 SDK
- A Guided Tour of Xcode 7
- Starting Xcode 7
- Creating the iOS App User Interface
- Changing Component Properties
- Adding Objects to the User Interface
- Building and Running an iOS 9 App in Xcode 7
- Running the App on a Physical iOS Device
- Managing Devices and Simulators
- Dealing with Build Errors
- Monitoring Application Performance
- An Exploded View of the User Interface Layout Hierarchy
- An Introduction to Xcode 7 Playgrounds
- What is a Playground?
- Creating a New Playground
- A Basic Swift Playground Example
- Viewing Results
- Enabling the Timeline Slider
- Adding Rich Text Comments
- Working with Playground Pages
- Working with UIKit in Playgrounds
- Adding Resources to a Playground
- Working with Enhanced Live Views
- When to Use Playgrounds
- Swift 2 Data Types, Constants and Variables
- Using a Swift Playground
- Swift Data Types
- Integer Data Types
- Floating Point Data Types
- Bool Data Type
- Character Data Type
- String Data Type
- Special Characters/Escape Sequences
- Swift Variables
- Swift Constants
- Declaring Constants and Variables
- Type Annotations and Type Inference
- The Swift Tuple
- The Swift Optional Type
- Type Casting and Type Checking
- Swift 2 Operators and Expressions
- Expression Syntax in Swift
- The Basic Assignment Operator
- Swift Arithmetic Operators
- Compound Assignment Operators
- Increment and Decrement Operators
- Comparison Operators
- Boolean Logical Operators
- Range Operators
- The Ternary Operator
- Bitwise Operators
- Bitwise NOT
- Bitwise AND
- Bitwise OR
- Bitwise XOR
- Bitwise Left Shift
- Bitwise Right Shift
- Compound Bitwise Operators
- Swift 2 Flow Control
- The Swift 2 Switch Statement
- An Overview of Swift 2 Functions
- What is a Function?
- How to Declare a Swift Function
- Calling a Swift Function
- Declaring External Parameter Names
- Declaring Default Function Parameters
- Returning Multiple Results from a Function
- Variable Numbers of Function Parameters
- Parameters as Variables
- Working with In-Out Parameters
- Functions as Parameters
- Closure Expressions
- Closures in Swift
- The Basics of Object Oriented Programming in Swift 2
- An Introduction to Swift Subclassing and Extensions
- Working with Array and Dictionary Collections in Swift 2
- Mutable and Immutable Collections
- Swift Array Initialization
- Working with Arrays in Swift
- Array Item Count
- Accessing Array Items
- Appending Items to an Array
- Inserting and Deleting Array Items
- Array Iteration
- Creating Mixed Type Arrays
- Swift Dictionary Collections
- Swift Dictionary Initialization
- Dictionary Item Count
- Accessing and Updating Dictionary Items
- Adding and Removing Dictionary Entries
- Dictionary Iteration
- Understanding Error Handling in Swift 2
- Creating an Interactive iOS 9 App
- An Introduction to Auto Layout in iOS 9
- Working with iOS 9 Auto Layout Constraints in Interface Builder
- A Simple Example of Auto Layout in Action
- Enabling and Disabling Auto Layout in Interface Builder
- The Auto Layout Features of Interface Builder
- Suggested Constraints
- Visual Cues
- Highlighting Constraint Problems
- Viewing, Editing and Deleting Constraints
- Creating New Constraints in Interface Builder
- Adding Aspect Ratio Constraints
- Resolving Auto Layout Problems
- An iOS 9 Auto Layout Example
- Implementing iOS 9 Auto Layout Constraints in Code
- Implementing Cross-Hierarchy Auto Layout Constraints in iOS 9
- Understanding the iOS 9 Auto Layout Visual Format Language
- Using Size Classes to Design Adaptable Universal iOS 9 User Interfaces
- Understanding Size Classes
- Size Classes in Interface Builder
- Setting “Any” Defaults
- Working with Size Classes in Interface Builder
- A Universal User Interface Tutorial
- Designing the iPad Layout
- Adding Universal Image Assets
- Designing the iPhone Layout
- Adding a Size Class Specific Image File
- Removing Redundant Constraints
- Testing the Application
- Using Storyboards in Xcode 7
- 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
- Organizing Scenes over Multiple Xcode Storyboard Files
- Using Xcode 7 Storyboards to Create an iOS 9 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
- Adding the View Controllers for the Content Views
- Adding the Tab Bar Controller to the Storyboard
- Designing the View Controller User interfaces
- Configuring the Tab Bar Items
- Building and Running the Application
- Working with the iOS 9 Stack View Class
- Introducing the UIStackView Class
- Understanding Subviews and Arranged Subviews
- StackView Configuration Options
- axis
- Distribution
- spacing
- alignment
- baseLineRelativeArrangement
- layoutMarginsRelativeArrangement
- Creating a Stack View in Code
- Adding Subviews to an Existing Stack View
- Hiding and Removing Subviews
- An iOS 9 Stack View Tutorial
- An iOS 9 Split View Master-Detail Example
- An Overview of Split View and Popovers
- About the Example Split View Project
- Creating the Project
- Reviewing the Project
- Configuring Master View Items
- Configuring the Detail View Controller
- Connecting Master Selections to the Detail View
- Modifying the DetailViewController Class
- Testing the Application
- A Guide to Multitasking in iOS 9
- Using iPad Multitasking
- Picture-In-Picture Multitasking
- iPad Devices with Multitasking Support
- Multitasking and Size Classes
- Multitasking and the Master-Detail Split View
- Handling Multitasking in Code
- willTransitionToTraitCollection(_:withTransitionCoordinator:)
- viewWillTransitionToSize(_:withTransitionCoordinator:)
- traitCollectionDidChange(_:)
- Lifecycle Method Calls
- Enabling Multitasking Support
- Opting Out of Multitasking
- An iOS 9 Multitasking Example
- Implementing a Page based iOS 9 Application with UIPageViewController
- An Example iOS 9 UIPageViewController Application
- Working with Directories in Swift on iOS 9
- The Application Documents Directory
- The NSFileManager, NSFileHandle and NSData Classes
- Understanding Pathnames in Swift
- 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 Files in Swift on iOS 9
- 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 9 Directory Handling and File I/O in Swift – A Worked Example
- Preparing an iOS 9 App to use iCloud Storage
- Managing Files using the iOS 9 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 9 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
- Running the iCloud Application
- Reviewing and Deleting iCloud Based Documents
- Making a Local File Ubiquitous
- Synchronizing iOS 9 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 9 Database Implementation using SQLite
- An Example SQLite based iOS 9 Application using Swift and FMDB
- About the Example SQLite Application
- Creating and Preparing the SQLite Application Project
- Checking Out the FMDB Source Code
- 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 9 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
- Generating a Managed Object Subclass
- Setting the Attributes of a Managed Object
- Saving a Managed Object
- Fetching Managed Objects
- Retrieving Managed Objects based on Criteria
- Accessing the Data in a Retrieved Managed Object
- An iOS 9 Core Data Tutorial
- The Core Data Example Application
- Creating a Core Data based Application
- Creating the Entity Description
- Generating the Managed Object Subclass
- Designing the User Interface
- Accessing the Managed Object Context
- Saving Data to the Persistent Store using Core Data
- Retrieving Data from the Persistent Store using Core Data
- Building and Running the Example Application
- An Introduction to CloudKit Data Storage on iOS 9
- An iOS 9 CloudKit Example
- About the Example CloudKit Project
- Creating the CloudKit Example Project
- Designing the User Interface
- Establishing Outlets and Actions
- Accessing the Public Database
- Hiding the Keyboard
- Implementing the selectPhoto method
- Saving a Record to the Cloud Database
- Implementing the notifyUser Method
- Testing the Record Saving Method
- Searching for Cloud Database Records
- Updating Cloud Database Records
- Deleting a Cloud Record
- Testing the Application
- An iOS 9 CloudKit Subscription Example
- Push Notifications and CloudKit Subscriptions
- Registering an App to Receive Push Notifications
- Configuring a CloudKit Subscription
- Handling Remote Notifications
- Implementing the didReceiveRemoteNotification Method
- Fetching a Record From a Cloud Database
- Completing the didFinishLaunchingWithOptions Method
- Testing the Application
- An Overview of iOS 9 Multitouch, Taps and Gestures
- An Example iOS 9 Touch, Multitouch and Tap Application
- The Example iOS 9 Tap and Touch Application
- Creating the Example iOS Touch Project
- Designing the User Interface
- Enabling Multitouch on the View
- Implementing the touchesBegan Method
- Implementing the touchesMoved Method
- Implementing the touchesEnded Method
- Getting the Coordinates of a Touch
- Building and Running the Touch Example Application
- Checking for Touch Predictions
- Accessing Coalesced Touches
- Detecting iOS 9 Touch Screen Gesture Motions
- Identifying Gestures using iOS 9 Gesture Recognizers
- The UIGestureRecognizer Class
- Recognizer Action Messages
- Discrete and Continuous Gestures
- Obtaining Data from a Gesture
- Recognizing Tap Gestures
- Recognizing Pinch Gestures
- Detecting Rotation Gestures
- Recognizing Pan and Dragging Gestures
- Recognizing Swipe Gestures
- Recognizing Long Touch (Touch and Hold) Gestures
- An iOS 9 Gesture Recognition Tutorial
- An iOS 9 3D Touch Force Handling Tutorial
- An iOS 9 3D Touch Quick Actions Tutorial
- An iOS 9 3D Touch Peek and Pop Tutorial
- Basic iOS 9 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 Variables
- Drawing in the UIView
- Detecting Screen Touches and Performing the Animation
- Building and Running the Animation Application
- iOS 9 UIKit Dynamics – An Overview
- Understanding UIKit Dynamics
- The UIKit Dynamics Architecture
- Dynamic Items
- Dynamic Behaviors
- The Reference View
- The Dynamic Animator
- Implementing UIKit Dynamics in an iOS 9 Application
- Dynamic Animator Initialization
- Configuring Gravity Behavior
- Configuring Collision Behavior
- Configuring Attachment Behavior
- Configuring Snap Behavior
- Configuring Push Behavior
- The UIDynamicItemBehavior Class
- Combining Behaviors to Create a Custom Behavior
- An iOS 9 UIKit Dynamics Tutorial
- An Introduction to iOS 9 Sprite Kit Programming
- An iOS 9 Sprite Kit Level Editor Game Tutorial
- About the Sprite Kit Demo Game
- Creating the SpriteKitDemo Project
- Reviewing the SpriteKit Game Template Project
- Restricting Interface Orientation
- Modifying the GameScene SpriteKit Scene File
- Creating the Archery Scene
- Transitioning to the Archery Scene
- Adding the Texture Atlas
- Designing the Archery Scene
- Preparing the Archery Scene
- Preparing the Animation Texture Atlas
- Creating the Named Action Reference
- Testing Actions in an Action File
- Triggering the Named Action from the Code
- Creating the Arrow Sprite Node
- Shooting the Arrow
- Adding the Ball Sprite Node
- An iOS 9 Sprite Kit Collision Handling Tutorial
- An iOS 9 Sprite Kit Particle Emitter Tutorial
- What is the Particle Emitter?
- The Particle Emitter Editor
- The SKEmitterNode Class
- Using the Particle Emitter Editor
- Particle Emitter Node Properties
- Background
- Particle Texture
- Particle Birthrate
- Particle Life Cycle
- Particle Position Range
- Angle
- Particle Speed
- Particle Acceleration
- Particle Scale
- Particle Rotation
- Particle Color
- Particle Blend Mode
- Experimenting with the Particle Emitter Editor
- Bursting a Ball using Particle Emitter Effects
- Adding the Burst Particle Emitter Effect
- Adding an Audio Action
- An iOS 9 MapKit Flyover Tutorial
- An Introduction to Extensions in iOS 9
- An iOS 9 Today Extension Widget Tutorial
- About the Example Extension Widget
- Creating the Example Project
- Adding the Extension to the Project
- Reviewing the Extension Files
- Designing the Widget User Interface
- Setting the Preferred Content Size in Code
- Modifying the Widget View Controller
- Testing the Extension
- Opening the Containing App from the Extension
- Creating an iOS 9 Photo Editing Extension
- Creating a Photo Editing Extension
- Accessing the Photo Editing Extension
- Configuring the Info.plist File
- Designing the User Interface
- The PHContentEditingController Protocol
- Photo Extensions and Adjustment Data
- Receiving the Content
- Implementing the Filter Actions
- Returning the Image to the Photos App
- Testing the Application
- Creating an iOS 9 Action Extension
- An Overview of Action Extensions
- About the Action Extension Example
- Creating the Action Extension Project
- Adding the Action Extension Target
- Changing the Extension Display Name
- Designing the Action Extension User Interface
- Receiving the Content
- Returning the Modified Data to the Host App
- Testing the Extension
- Declaring the Supported Content Type
- Receiving Data from an iOS 9 Action Extension
- Accessing the iOS 9 Camera and Photo Library
- An Example iOS 9 Camera Application
- iOS 9 Video Playback using AVPlayer and AVPlayerViewController
- An iOS 9 Multitasking Picture in Picture Tutorial
- Playing Audio on iOS 9 using AVAudioPlayer