Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover
Title
Copyright
Dedication
Contents at a Glance
Contents
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
Chapter 1: Got Tools?
Requirements
Installing Xcode
What is Xcode?
Becoming an iOS Developer
Getting the Projects
Launching Xcode the First Time
Welcome To Xcode
Navigation Area
Editor Area
Utility Area
Debug Area
Toolbar
Running Your First App
Summary
Chapter 2: Boom! App
Design
Creating the Project
Setting Project Properties
Building an Interface
Adding Objects
Deleting and Connecting Objects
Adding Views to a View
Editing Object Properties
Adding Resources
Customizing Buttons
Using Storyboards
Adding New Screens
Creating a Segue
Setting Navigation Titles
Testing Your Interface
Finishing Your App
Debugging Your App
Adding Constraints
Testing Your App
Summary
Chapter 3: Spin a Web
Design
Creating the Project
Building a Web Browser
Coding a Web Browser
Adding Outlets to SUViewController
Connecting Custom Outlets
Adding Actions to SUViewController
Setting Action Connections
Testing the Web Browser
Debugging the Web View
Adding URL Shortening
Designing the URL Shortening Code
Becoming a Web View Delegate
Shortening an URL
Final Touches
Cleaning Up the Interface
Creating the iPad Version
Summary
Chapter 4: Coming Events
Run Loop
Event Queue
Event Delivery
Direct Delivery
Hit Testing
The First Responder
Event Handling
The Responder Chain
High- vs. Low-Level Events
Eight Ball
Design
Create the Project
Create the Interface
Writing the Code
Handling Shake Events
Testing Your EightBall App
Finishing Touches
Testing on a Physical iOS Device
Other Uses for The Responder Chain
Touchy
Design
Creating the Project
Creating a Custom View
Handling Touch Events
Drawing Your View
Adding Custom Objects in Interface Builder
Testing Touchy
Advanced Event Handling
Summary
Chapter 5: Table Manners
Table Views
Plain Tables
Grouped Tables
Cell Styles
Cell Accessories
Custom Cells
How Table Views Work
Table Cells and Rubber Stamps
MyStuff
Design
Creating The Project
Creating Your Data Model
Creating a Data Source
Implementing Your Rubber Stamp
Table Cell Caching
Where’s the Data?
Testing MyStuff
Adding the Detail View
Creating the Detail View
Configuring the Detail View
Editing
Inserting and Removing Items
Enabling Table Editing
Editing Details
Observing Changes to MyWhatsit
Modal vs. Modeless Editing
Little Touches
Advanced Table View Topics
Summary
Chapter 6: Object Lesson
Two Houses, Both Alike in Dignity
Romeo Meets Juliet
Classes and Cookies
Classes and Objects and Methods, Oh My!
Inheritance
Abstract and Concrete Classes
Overriding Methods
Design Patterns and Principles
Encapsulation
Singularity of Purpose
Stability
Open Closed
Delegation
Other Patterns
Summary
Chapter 7: Smile!
Design
Extending Your Design
Revising the Data Model
Adding an Image View
Updating the View Controller
Connecting a Choose Image Action
Taking Pictures
You Can’t Always Get What You Want
Presenting the Image Picker
Importing the Image
Cropping and Resizing
Winding Up
Testing the Camera
Building the iPad Interface
Adding a Popover
Sticky Keyboards
Advanced Camera Techniques
Summary
Chapter 8: Model Citizen
The Model-View-Controller Design Pattern
Data Model Objects
View Objects
Controller Objects
MVC Communications
Color Model
Creating Your Data Model
Creating View Objects
Writing Your Controller
Wiring Your Interface
Having Multiple Views
Consolidating Updates
Complex View Objects
Replacing UIView with CMColorView
Connecting the View to Your Data Model
Drawing CMColorView
Being a K-V Observer
Key Value Observing
Observing Key Value Changes
Creating KVO Dependencies
Multi-Vector Data Model Changes
Handling Touch Events
Binding The Sliders
Final Touches
Cheating
Summary
Chapter 9: Sweet, Sweet Music
Making Your Own iPod
Design
Adding a Music Picker
Using a Music Player
Adding Playback Control
Receiving Music Player Notifications
Adding Media Metadata
Observing the Playing Item
Make Some Noise
Living in a Larger World
Configuring Your Audio Session
Playing Audio Files
Creating AVAudioPlayer objects
Adding the Sound Buttons
Activating Your Audio Session
Interruptions and Detours
Dealing with Interruptions
Adding Your Interruption Handlers
Dealing with Audio Route Changes
Other Audio Topics
Summary
Chapter 10: Got Views?
Learning by Example
Buttons
The Responder and View Classes
The Control Class
Button Types
Control States
Button Code
Switches and Sliders
Page Control
Steppers
Segmented Controls
Progress Indicators
Text Views
Labels
Text Fields
Text Editing Behavior
Text Views
Pickers
Date Picker
Anything Picker
Image Views
Grouped Tables
The View You Never See
Summary
Chapter 11: Draw Me a Picture
Creating a Custom View Class
View Coordinates
When Views Are Drawn
Drawing a View
Shapely
Creating Views Programmatically
The -drawRect: Method
More Shapes, More Colors
Transforms
Applying a Translate Transform
Applying a Scale Transform
Animation: It’s Not Just for Manga
Using Core Animation
Adding Animation to Shapely
OpenGL
The Order of Things
Images and Bitmaps
Creating Images from Bitmaps
Creating Bitmaps From Drawings
Advanced Graphics
Text
Shadows, Gradients, and Patterns
Blend Modes
The Context Stack
Summary
Chapter 12: There and Back Again
Measure Twice, Cut Once
What is Navigation?
View Controller Roles
Designing Wonderland
Weighing Your Navigation Options
Wonderland Navigation
Creating Wonderland
Adding Wonderland’s Resources
Configuring a Tab Bar Item
The First Content View Controller
Presenting a Modal View Controller
Dismissing a View Controller
Creating a Navigable Table View
Breathing Data Into Your Table View
Pushing the Detail View Controller
Creating a Page View Controller
Adding the Page View Controllers
Designing a Prototype Page
Coding the One Page View
The Paginator
Coding the Page View Data Source
Initializing a Page View Controller
Using Pop-Over Controllers
Advanced Navigation
Summary
Chapter 13: Networking, the Social Kind
Color My (Social) World
Having Something to Share
Presenting the Activity View Controller
Sharing More
Extracting Code
Providing More Items to Share
Excluding Activities
The Curse of the Lowest Common Denominator
Providing Activity Specific Data
Promises, Promises
Big Data
Sharing with Specific Services
Other Social Network Interactions
Summary
Chapter 14: Networking, The Nerdy Kind
SunTouch
Creating SunTouch
Designing the Initial Screens
Creating the Single Player Version
Loading STGameViewController
How SunTouch Works
Customizing Core Animations
Playing the Game
Plugging into Game Center
Configuring a Game Center–aware app
Enabling Game Center
Creating an App in the iTunes Store
Configuring Game Center
Adding GameKit to Your App
Obtaining the Local Player
Adding a Game Center Button
Recording Leaderboard Scores
Creating a Test Player
Peer-To-Peer Networking
Turning SunTouch Into a Two-Player Game
Matchmaking
Exchanging Data with Another Device
Advanced Networking
One Last Detail
Summary
Chapter 15: If You Build It . . .
How Interface Builder Files Work
Compiling Interface Builder Files
Loading a Scene
Loading an .xib File
Placeholder Objects and the File’s Owner
Creating Objects
Editing Attributes
Connections
Sending Action Messages
Taking Control of Interface Builder Files
Declaring Placeholders
Designing SYShapeView
Connecting the Gesture Recognizers
Build Your Shape Factory
Loading an Interface Builder File
Replacing Code
Summary
Chapter 16: Apps with Attitude
Leveler
Creating Leveler
Getting Motion Data
Creating CMMotionManager
Starting and Stopping Updates
Push Me, Pull You
Timing is Everything
Herky-Jerky
Getting Other Kinds of Motion Data
Gyroscope Data
Magnetometer Data
Device Motion and Attitude
Measuring Change
Summary
Chapter 17: Where Are You?
Creating Pigeon
Collecting Location Data
Using a Map View
Decorating Your Map
Adding an Annotation
Map Coordinates
Adding a Little Bounce
Pointing the Way
Location Monitoring
Approximate Location and Non-GPS Devices
Monitoring Regions
Reducing Location Change Messages
Movement and Heading
Geocoding
Getting Directions
Summary
Chapter 18: Remember Me?
Property Lists
Serializing Property Lists
User Defaults
Making Pigeon Remember
Minimizing Updates and Code
Defining Your Keys
Writing Values to User Defaults
Getting Values from User Defaults
Testing User Defaults
Registering Default Values
Turning Objects into Property List Objects
Preserving and Restoring savedLocation
Persistent Views
Fading Into the Background
Preserving View Controllers
Assigning Restoration Identifiers
Customizing Restoration
Deeper Restoration
Pigeons in the Cloud
Storing Values in the Cloud
Cloud Watching
Enabling iCloud
Testing the Cloud
Bundle Up Your Settings
Creating a Settings Bundle
Using Your Settings Bundle Values
Testing Your Settings Bundle
Summary
Chapter 19: Doc, You Meant Storage
Document Overview
Where, Oh Where, Do My Documents Go?
MyStuff on Documents
Supplying Your Document’s Data
Wrapping Up Your Data
Using Wrappers
Incremental Document Updates
Constructing Your Wrappers
Interpreting Your Wrappers
Archiving Objects
Adopting NSCoding
Archiving and Unarchiving Objects
The Archiving Serialization Smackdown
Serialization, Meet Archiving
Document, Your Data Model
Tracking Changes
Testing Your Document
Setting Breakpoints
Stepping Through Code and Examining Variables
Storing Image Files
Odds and Ends
iCloud Storage
Archive Versioning
Summary
Chapter 20: Being Objective
Objective‑C is C
Objective‑C Classes
Implementing Your Class
Creating and Destroying Objects
Class Clusters
Referring to Objects
Can I See Your id?
Method Names
Method Name Construction
The +initialize Method
Properties
Instance Variables
Using Getters and Setters
Declared Properties
Automatic Properties
The Anatomy of a Property
Keeping Your Promises
Introspection
Class
Method
Protocol
Protocols
Adopting Protocols
Referring to Conforming Objects
Categories
Single Responsibility
Module Organization
Private Methods
Extensions
nil is Your Friend
The Unbearable Lightness of nil
The Virtues of Being Positive
When nil Is Bad
Copying Objects
Adopting NSCopying
Inheriting NSCopying
Copying Something Special
Copying an Object
Mutable Copies
Attributed Strings
Collections
Collection Classes
Enumeration
Fast Object Enumeration
Collection Enumeration
Shortcuts
Summary
Chapter 21: The Elephant in the Room
Memory Management
Your Grandfather’s Memory Management
Garbage Collection
Reference Counting
Manual Reference Counting
Jumping into the Pool
Quick Summary
Breaking the Cycle
Scared Straight
Automatic Reference Counting
Enabling ARC
Strong and Weak References
What ARC Doesn’t Do
Summary
Chapter 22: Êtes-vous Polyglotte?
The Localization Process
Language Bundles
Programmatic Localization
Localize Now!
Internationalizing Your App
Internationalizing String Constants
Using the genstrings Tool
Localizing Your Strings File
Testing Your String Localization
Localizing Interfaces Using Localizable Strings
Localizing Settings.bundle
Other Code Considerations
Localizing Your App’s Name
Summary
Chapter 23: Faster, Faster
Performance Optimization
Fixing a Slow Tap
Launching Instruments
Finding the Hot Spots
The Hubris of Experience
Picking the Low Hanging Fruit
Deferring Notifications
Once More into The Breach
Precious Memory
Breaking MyStuff
Measuring Memory
Memory Instruments
Heed the Warnings
Stress Test, Round #
Summary
Chapter 24: Twice As Nice
Concurrent Programming
Threads
Synchronization
Running Multiple Threads
Creating an Operation Queue
Adding an Operation
Measuring the Effects
Execution Order
Thread Safety
Don’t Talk About Thread Safety
Not Sharing Is Caring
Promise Me You’ll Never Change
The Atomic Age
Concurrency Roundup
The Thread-Safe Landscape
Sending Messages To Main
Lock Objects
Deadlocks
Spin Locks
Further Reading
Summary
Index
← Prev
Back
Next →
← Prev
Back
Next →