Home Page Icon
Home Page
Table of Contents for
Images
Close
Images
by Fritz Anderson
Xcode 6 Start to Finish: iOS and OS X Development, Second Edition
About This eBook
Title Page
Copyright Page
Dedication Page
Contents at a Glance
Contents
Acknowledgments
About the Author
Introduction
How This Book Is Organized
First Steps
The Life Cycle of an iOS Application
Xcode for Mac OS X
Xcode Tasks
Appendixes
About Versions
About the Code
Conventions
Part I: First Steps
1. Getting Xcode
Before You Begin
Developing for Earlier Operating Systems
Requirements
Installing Xcode
Command-Line Tools
Removing Xcode
Apple Developer Programs
Downloading Xcode
Additional Downloads
Summary
2. Kicking the Tires
Starting Xcode
Hello World
A New Project
Quieting Xcode Down
Building and Running
The Real Thing
Getting Rid of It
Summary
3. Simple Workflow and Passive Debugging
Creating the Project
Building
Running
Simple Debugging
Summary
4. Active Debugging
A Simple Test Case
Going Active
Setting a Breakpoint
The Variables Pane
Stepping Through
Fixing the Problem
Behaviors
The Fix
Summary
5. Compilation
Compiling
Dynamic Loading
Xcode and Clang
Local Analysis
Cross-Function Analysis
Indexing
Swift
Compiler Products
Intermediate Products
Precompilation
Summary
6. Adding a Library Target
Adding a Target
Targets
Target Membership
Adding Files to a Target
Headers in Targets
A Dependent Target
Adding a Library
Debugging a Dependent Target
Summary
7. Version Control
Taking Control
Creating a Git Repository by Hand
The State of Your Files
How Xcode Works with Git
Your First Commit
Working with Remote Repositories
Setting Up a “Remote”—Locally
Pushing to the Remote
Merges and Conflicts
User A
User B
Back to User A
The Version Editor
Comparison
Blame
Log
Branching
Summary
Part II: The Life Cycle of an iOS Application
8. Starting an iOS Application
Planning the App
Model-View-Controller
The Model
The Views
The Controllers
Starting a New iOS Project
Target Editor
What’s in the Project
Summary
9. An iOS Application: Model
Implementing the Model
Entities
Attributes
Relationships
Managed-Object Classes
Creating the Classes—the Wrong Way
Why Doing It Xcode’s Way Is a Mistake
The Right Way—mogenerator
Preparation
Utilities
Extensions
passer rating
Specializing the Core Data Classes
Putting Game to Work
Putting Passer to Work
Some Test Data
Source Control and Product Files
Making the Model Easier to Debug
Summary
10. An iOS Application: Controller
Renaming Symbols in Objective-C
Refactoring the Name of an Objective-C Method
Refactoring a Class Name
Renaming a Class in Swift
Editing the View Controller
The Table View
Setting Up the Passer List
Creating a New Passer
Live Issues and Fix-it
The Real Passer Rating
Another Bug
Running Passer Rating
Summary
11. Building a New View
The Next View Controller
If You Want to Add a View Controller
Storyboards, Scenes, and Segues
Building a View
Outlets and Assistants, in Passing
The Billboard View
Linking Views to a View Controller
Auto Layout for the Nonce
Lots of Labels
Cleaning Up
The Table View
Outlets
Hooking Up the Outlets
Checking Connections
Connecting GameListController
Code Completion and Snippets
Code Snippets
Testing the Billboard View
Summary
12. Auto Layout in a New View
Why Auto Layout?
Limitations of Autoresizing
Auto Layout
The Thing to Remember
The Player Billboard, Revisited
Why You Should Do More
Factoring Layout into Subviews
The Playground
StatView
Installing StatView
Planning Constraints
Two Line Counts, Two Labels
Constraints for Real
Default (Any/Any)
Any Height (not Compact)
Landscape (wAny/hCompact)
Chasing Issues
A Tweak
Summary
13. Adding Table Cells
The Game Table
Outlets in the Table View
Adding Required Protocol Methods
Adding Model-to-View Support
A Prototype Cell
The Game Table: First Run
A Custom Table Cell
Adding Some Graphics
A Cell with an Image in It
Hooking the Image View to the Images
The Assets Catalog
Adding Images to the Assets Catalog
Icons and Launch Displays
Summary
14. Adding an Editor
The Plan
Adding a Modal Scene
An Embedded View Controller
Linking the Editor to the Passer List
Static Table Cells
The Editor View Controllers
The Editor Table
Passing the Data to the Editor
Getting the Data Back
Segues
Summary
15. Unit Testing
The Test Navigator
Testing the CSV Reader
The CSV Test Code
Test Data
Running the Tests
Testing and the Debugger
Adding a Test Class
Asynchronous Tests
Testing Asynchronous Code
Documentation of Last Resort
XCTest Assertions
Simple Tests
Equality
Exceptions
Summary
16. Measurement and Analysis
Speed
The Debug Navigator
Instruments
XCTest and Performance
Memory
Summary
17. An iOS Extension
Adding the Today Target
Designing the Widget
Data Access
A Shared Library in a Framework
The Today Extension
Build Dependencies
The Result
Summary
18. Provisioning
Apple Developer Programs
General (App Store) Program
Enterprise Program
Provisioning for iOS
What You’ll See
Registering Your App
Protecting Your Assets
Prerelease Distributions
The Capabilities Editor
OS X-only Capability
Capabilities for Both iOS and OS X
iOS Capabilities
OS X Sandboxing
Why Sandbox?
Why Not Sandbox?
Gatekeeper and Developer ID
Getting a Developer ID
Using Developer ID
Limitations
Distribution Builds
Basic Build Settings
Adjusting the Build Settings
The Build
Summary
Part III: Xcode for Mac OS X
19. Starting an OS X Application
The Goal
Getting Started
Model
Porting from iOS
Adding an Entity
Wiring a Menu
Target/Action
First Responder
Loading Data into LeagueDocument
Adapting to a Managed Document
Testing the Command
Identifying a Type for League Data
Specifying How the App Handles League Files
Application and Document Icons
Summary
20. Bindings: Wiring an OS X Application
Storyboard Segues in OS X
Building the Document Window
Loading the Window
A Table View
Filling the Table—Bindings
Object Controllers
Binding the Table to the Teams
Binding the Columns to Team Properties
The Arc of League Document Data
From League Table to Source List
Capturing the Team Selection
From Team to Tables
The Passer Section
Summary
21. Localization
How Localization Works
Adding a Localization
Base Localization
Why Base Localization?
Something Worth Localizing
Game Detail View: Layout
Game Detail View: Code
Modules and Namespaces
Localizing for French
Adding a Locale
Starting Simple: Credits.rtf
Localizing Main.storyboard
Localizing Resources
Localizing Program Strings
genstrings
xliff Files
The Rest
Localizing System Strings
Summary
22. Bundles and Packages
A Simple Package: RTFD
Bundles
Application Bundles
The Info.plist File
Localizing Info.plist
Info.plist Keys for Applications
Keys for Both iOS and OS X
Keys for OS X
Keys for iOS
Summary
23. Property Lists
Property List Data Types
Editing Property Lists
The Property List Editor
Why Not the Property List Editor?
Other Formats
Text Property Lists
Binary Property Lists
JSON
Specialized Property Lists
Summary
Part IV: Xcode Tasks
24. Documentation in Xcode
Quick Help
Inspector
Popover
Open Quickly
Help
The Documentation Window
The Navigator Sidebar
The Table of Contents Sidebar
Class Info
Searching and Navigation
Keeping Current
Your Own Quick Help
C-Family Documentation
Doxygen
Running Doxygen
Installing a Docset
Swift and reStructuredText
Summary
25. The Xcode Build System
How Xcode Structures a Build
Build Variables
Settings Hierarchy
Levels
Editing Build Variables
Configurations
Adjusting Configurations
Configuration Files
Creating a Configuration File
SDK- and Architecture-Specific Settings
Preprocessing xcconfig Files
Command-Line Tools
xcodebuild
xcode-select
xcrun
Custom Build Rules
Builds in the Report Navigator
A Simple Build Transcript
Summary
26. Instruments
What Instruments Is
Running Instruments
The Trace Document Window
Toolbar
Track Area
Detail Area
Extended Detail Area
Library
Tracing
Recording
Saving and Reopening
Tracing without Instruments
The Instruments
Behavior
Core Data
Dispatch
Filesystem
Graphics
Input/Output
Master Tracks
Memory
System
System—iOS Energy Instruments
Threads/Locks
Trace
UI Automation
User Interface
Custom Instruments
The Templates
All Platforms
iOS Only
Mac Only
Summary
27. Debugging
Scheme Options
Info
Arguments
Options
Diagnostics
Doing More with Breakpoints
View Hierarchy
The lldb Command Line
Tips
Summary
28. Snippets
Tricks
General
Code-Folding Ribbon
The Assistant Editor
Instruments and Debugging
Building
Traps
Part V: Appendixes
A. Some Build Variables
Useful Build Variables
Environment
Code Signing
Locations
Compiler Settings
Other Tools
Info.plist
Search Paths
The DEVELOPER_ Variables
Source Trees
B. Resources
Books
Books about Swift
On the Net
Forums
Mailing Lists
Developer Technical Support
Sites and Blogs
Face to Face
Meetings
Classes
Other Software
Text Editors
Helpers
Package Managers
Version Control
AppCode
Alternatives to Cocoa
Index
Code Snippets
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Images
Next
Next Chapter
Images
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset