售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Learning Xcode 8
Table of Contents
Learning Xcode 8
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Starting Your iOS Journey
A developer's responsibilities
Pre-production
Project setup
Development
Deployment
Working on a team
Designers
Other programmers
Project managers
Investors
The Xcode 8 toolset
Xcode
iOS and watchOS simulator
Instruments
Application Loader
Understanding Model-View-Controller (MVC)
Model
View
Controller
MVC on the web
MVC on iOS
Becoming a registered developer
Which account do you need?
Registering a free developer account
Registering a paid developer account
Summary
2. Welcome to Xcode
Getting started
Installing Xcode
Adding your developer account
Creating a new project
Navigating Xcode
Editor
Navigator sidebar
Debug area
Utilities sidebar
Exploring the editor
Standard editor
Assistant editor
Version editor
Understanding project settings
Project targets
The General tab
The Capabilities tab
The Info tab
Creating and managing files
Resource types
Creating new resources
Importing existing files
Groups and folders
Creating builds
Build and run
Running on a device
Applying the basics
Setting up the workspace
Creating the model, view, and controller
Testing our work in the simulator
Summary
3. Introduction to Swift 3
Discovering playgrounds
Setting up a playground
Using previews
Resources, pages, and rich comments
Resources
Pages
Rich comments
Understanding Swift basics
Data types, constants, and variables
Data types
Constants
Variables
Optionals
Collection types
Arrays
Dictionaries
Conditional statements
if statement
guard statement
switch statement
Loops
for loop
for-in loop
while loop
repeat-while loop
Functions
Comments and printing
Creating classes, structs, and enums
Classes
Structs
Enumerations
Using important Swift features
Closures
Protocols
Class extensions
Error handling
Summary
4. Using Storyboards, Auto Layout, and Size Classes
Storyboards
Getting started
View controllers and screen flow
Understanding segues
Auto Layout
The view hierarchy
Constraints
Resolving issues
Size classes
Devices, orientations, and size classes
Size classes in action
Summary
5. Taking Advantage of Source Control in Xcode
Understanding version control
Introduction to Git
Setting up Git in Xcode
Creating a local repository
Adding Git to an existing project
Using a GitHub hosted repository
Using version control in Xcode
Pull, push, and commit
The version editor
Creating and merging branches
Summary
6. Building Your First iOS App
Pre-production
Assembling a feature list
Visual design
Creating a development plan
New snippet
SnippetData model
New snippet button
Select snippet type
Update SnippetData model
Create an alert controller
Text snippet implementation
Update SnippetData model
Text entry view controller
PhotoSnippet implementation
Update SnippetData model
PhotoSnippet data entry
Scroll through snippets
Create prototype cells
Populate table view
Snippet dates
Update SnippetData model
Save data to model
Update view and controller
Summary
7. Integrating Multitouch and Gestures
Human interface guidelines – gestures
Standard gestures
Usage guidelines
How gestures work
Adding gestures from the storyboard
Setting up the storyboard
Flipping the image
Adding gestures from code
Creating a gesture through code
Reading the gesture data
Changing the scale of our image
If you're up for a challenge…
Creating 3D Touch app shortcuts
Setting up Info.plist
Handling shortcuts in the app delegate
Summary
8. Exploring Common iOS Frameworks
Frameworks
What is a framework?
Linking frameworks in a project
Understanding UIKit fundamentals
Application management
The UIDevice class
Views
Drawing
Hierarchies
Coordinate systems
Documents, displays, printing, and more
Documents
Displays
Printing
And more!
Using CoreLocation.framework
Setting up CoreLocation permissions
Getting the user's location
Adding location data to Snippets
Using Social.framework
Setting up the views
Posting to Twitter
Summary
9. Working with Core Data
What is Core Data?
Model revisited
Entities, attributes, and relationships
Entities
Attributes
Relationships
The data model editor
Preparing Snippets for Core Data
Initializing the Core Data stack
Data model versus object graph
The NSManagedObjectModel
The NSPersistentStoreCoordinator
The NSManagedObjectContext
Final touches
Recreating the data model with Core Data
Persisting data
Saving data
Fetching data
Deleting data
Summary
10. Creating a watchOS Companion App
Designing for the Apple Watch
Using the watch
Intended experience
Apple's design principles
Components of a watchOS app
The watchOS app
Dock snapshots
Notifications
Complications
Architecture of a watchOS app
Target bundles
Watch App bundle
Watch Extension bundle
Interface controller
Extension Delegate
Snippets for Apple Watch
Setting up our project
Creating a watchOS storyboard
Programming the interface controller
Connecting to iOS with Watch Connectivity.framework
Adding a complication
Summary
11. Advanced Input Using Sensors
Device status with UIDevice
Accessing orientation state
Checking the proximity sensor
Getting battery status
Introduction to Core Motion
Accelerometer
Gyroscope
CMDeviceMotion
User acceleration
Gravity
Rotation rate
Magnetic field
Charting motion data
Charts
Importing the framework
Setting up the storyboard
Filling the chart with data
Pedometer
Altitude
Sensors on Apple Watch
Setting up an extension
Getting sensor data on Apple Watch
Sending and displaying data on iOS
Summary
12. Sending Notifications
Introduction to user notifications
Components of a user notification
Local versus remote notifications
Adding notification support to Snippets
Getting permission to send notifications
Scheduling a local notification
Advanced notifications
Categories and actions
Badges
Custom sounds
Receiving notifications while in the app
Summary
13. Writing Unit Tests
Introduction to unit tests
What is a unit?
Why use unit testing in the first place?
Unit tests in action
Setting up the project
Writing tests with XCTest
Running tests
Implementing tests for Snippets
Setting up the Snippets project
Preparing our testing class
Writing a data validation unit test
Checking code coverage
Testing UI in Xcode 8
How does UI testing work?
Adding the UI testing target
Using the UI recorder
Summary
14. Debugging an iOS Application
Basic debugging practices
print()
Breakpoints and the debug area
Variables view
Console
Debug toolbar
The call stack
Advanced debugging tools
Address Sanitizer
Performance gauges
CPU and memory gauge
Disk and network gauge
Energy gauge
Visual debugging
Summary
15. Optimizing Your App
Introduction to Instruments
Time Profiler instrument
Anatomy of an Instruments document
Using the Time Profiler
Allocations instrument
Leaks instrument
App Thinning
Slicing
Bitcode
On-demand Resources
Creating tags
Loading resources
Purging resources
Summary
16. Distributing an iOS App
Preparing iTunes Connect
Registering a bundle identifier
Creating a new app record in iTunes Connect
Uploading to iTunes Connect
Releasing the app
Finalizing store assets
Distributing on TestFlight
Submitting to the App Store
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜