Learning Xcode 8
eBook - ePub

Learning Xcode 8

Jak Tiano

Share book
  1. 480 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning Xcode 8

Jak Tiano

Book details
Book preview
Table of contents
Citations

About This Book

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 computing and the birth of world-changing mobile apps. With a reputation as one of the most user-centric and developer-friendly platforms, iOS is the best place to launch your next great app idea. As the official tool to create iOS applications, Xcode is chock full of features aimed at making a developer's job easier, faster, and more fun.

This book will take you from complete novice to a published app developer, and covers every step in between. You'll learn the basics of iOS application development by taking a guided tour through the Xcode software and Swift programming language, before putting that knowledge to use by building your first app called "Snippets." Over the course of the book, you will continue to explore the many facets of iOS development in Xcode by adding new features to your app, integrating gestures and sensors, and even creating an Apple Watch companion app. You'll also learn how to use the debugging tools, write unit tests, and optimize and distribute your app. By the time you make it to the end of this book, you will have successfully built and published your first iOS application.

Style and approach

This easy-to-follow guide presents topics in a hands-on lecture format where concepts are introduced and explained, then used in an example as reinforcement. The first third of the book covers the separate building blocks of development, while the second two thirds cover the development of an app from start to finish.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Learning Xcode 8 an online PDF/ePUB?
Yes, you can access Learning Xcode 8 by Jak Tiano in PDF and/or ePUB format, as well as other popular books in Computer Science & Application Development. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781785885723
Edition
1

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 ...

Table of contents