Learning Xcode 8

Author: Jak Tiano  

Publisher: Packt Publishing‎

Publication year: 2016

E-ISBN: 9781785888373

P-ISBN(Paperback): 9781785885723

Subject: TP301.6 algorithm theory;TP31 computer software;TP399 In other aspects of the application

Keyword: 在其他方面的应用,自动化技术、计算机技术,算法理论,计算机软件

Language: ENG

Access to resources Favorite

Disclaimer: Any content in publications that violate the sovereignty, the constitution or regulations of the PRC is not accepted or approved by CNPIEC.

Description

Learn how to use the power of Xcode to turn your next great app idea into a reality About This Book • Learn the theory and tools behind app development using Swift 3 and Xcode 8 • Build a fully featured iOS app, including a companion app for the Apple Watch • Optimize, debug, and ultimately release your app on Test Flight and the App Store Who This Book Is For This book is intended for programmers looking to get a jump-start into the world of iOS development. Whether you're a young student who has only spent a few months with Java, or a seasoned developer who has spent their career developing for a different platform, all that is expected is a basic understanding of a programming language such as C++, C#, or Java. What You Will Learn • Understand the most important features of the Xcode IDE • Write Swift 3 code for application data models and view controllers • Prepare visual layouts for an iOS application using storyboards, size classes, and auto-layout • Integrate many common technologies into an app, such as multi-touch gestures, CoreData, and notifications • Build companion applications for the Apple Watch with watchOS 3 • Debug applications using Xcode's suite of debugging tools, and prevent bugs with unit testing • Optimize an application using Xcode 8's profiling tools and asset catalogs • Distribute a beta application through TestFlight, and a finished application through the App Store In Detail Over the last few years, we've seen a breakthrough in mobile com

Chapter

Chapter 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

Chapter 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

Chapter 3: Introduction to Swift 3

Discovering playgrounds

Setting up a playground

Resources, pages, and rich comments

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

Chapter 4: Using Storyboards, Auto Layout, and Size Classes

Storyboards

Getting started

View controllers and screen flow

Understanding segues

Auto Layout

Constraints

Resolving issues

Size classes

Devices, orientations, and size classes

Size classes in action

Summary

Chapter 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

Chapter 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

Chapter 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

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

Chapter 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

Chapter 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

Chapter 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

Dock snapshots

Notifications

Architecture of a watchOS app

Target bundles

Watch App bundle

Interface controller

Extension Delegate

Snippets for Apple Watch

Programming the interface controller

Connecting to iOS with Watch Connectivity.framework

Adding a complication

Summary

Chapter 11: Advanced Input Using Sensors

Device status with UIDevice

Accessing orientation state

Checking the proximity sensor

Getting battery status

Introduction to Core Motion

Accelerometer

CMDeviceMotion

User acceleration

Gravity

Rotation rate

Magnetic field

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

Chapter 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

Chapter 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

Chapter 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

Chapter 15: Optimizing Your App

Introduction to Instruments

Time Profiler instrument

Anatomy of an Instruments document

Using the Time Profiler

Allocations instrument

Leaks instrument

Slicing

On-demand Resources

Creating tags

Loading resources

Purging resources

Summary

Chapter 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

The users who browse this book also browse


No browse record.