Swift Essentials - Second Edition
eBook - ePub

Swift Essentials - Second Edition

Dr Alex Blewitt

Partager le livre
  1. 248 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Swift Essentials - Second Edition

Dr Alex Blewitt

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Discover how to build iOS and watchOS applications in Swift 2 using XcodeAbout This Book‱ Gets you up and running with Swift programming without any prior iOS development experience.‱ A fast paced guide showing best practices and lets you get up to speed with Swift to quickly build your own iOS applications‱ A unique practical approach to make your life with Swift easy.Who This Book Is ForAre you interested in learning Swift? Do you want to write iOS applications in Swift? If yes, then this is the book for you. No prior iOS programming experience is assumed; however, having some experience with any programming language will be beneficial.What You Will Learn‱ Dive into Swift and explore its innovative and powerful syntax‱ Work with Swift in Xcode to get a unique and productive approach to development‱ Find out how to create complete iOS applications‱ Discover rapid prototyping with a Swift playground‱ Get to know how to use the Swift storyboard to develop multi-page applications‱ Get to grips with parsing JSON and XML data from network sources‱ Build a network client for GitHub repositories, with full source code on GitHubIn DetailSwift was considered one of the biggest innovations last year, and certainly with Swift 2 announced at WWDC in 2015, this segment of the developer space will continue to be hot and dominating.This is a fast-paced guide to provide an overview of Swift programming and then walks you through in detail how to write iOS applications. Progress through chapters on custom views, networking, parsing and build a complete application as a Git repository, all by using Swift as the core languageStyle and approachThis fast-paced practical guide will quickly give you hands-on experience with all the features of Swift programming. Following the practical examples in the book will help you successfully create your own iOS applications.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Swift Essentials - Second Edition est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Swift Essentials - Second Edition par Dr Alex Blewitt en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Informatique et Programmation d'appareils mobiles. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2016
ISBN
9781785880964

Swift Essentials Second Edition


Table of Contents

Swift Essentials Second Edition
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Trademarks
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Exploring Swift
Open source Swift
Getting started with Swift
Numeric literals
Floating point literals
String literals
Variables and constants
Collection types
Optional types
Nil coalescing operator
Conditional logic
If statements
Switch statements
Iteration
Iterating over keys and values in a dictionary
Iteration with for loops
Break and continue
Functions
Named arguments
Optional arguments and default values
Guards
Multiple return values and arguments
Returning structured values
Error handling
Throwing errors
Catching errors
Cleaning up after errors
Command-line Swift
Interpreted Swift scripts
Compiled Swift scripts
Summary
2. Playing with Swift
Getting started with playgrounds
Creating a playground
Viewing the console output
Viewing the timeline
Displaying objects with Quick Look
Showing colored labels
Showing images
Advanced techniques
Capturing values explicitly
Running asynchronous code
Playgrounds and documentation
Learning with playgrounds
Understanding the playground format
Adding a page
Documenting code
Playground navigation documentation
Text formatting
Symbol documentation
Limitations of playgrounds
Summary
3. Creating an iOS Swift App
Understanding iOS applications
Creating a single-view iOS application
Removing the storyboard
Setting up the view controller
Swift classes, protocols, and enums
Classes in Swift
Subclasses and testing in Swift
Protocols in Swift
Enums in Swift
Raw values
Associated values
Creating a master-detail iOS application
The AppDelegate class
The MasterViewController class
The DetailViewController class
Summary
4. Storyboard Applications with Swift and iOS
Storyboards, scenes, and segues
Creating a storyboard project
Scenes and view controllers
Adding views to the scene
Segues
Adding a navigation controller
Naming scenes and views
Swift and storyboards
Custom view controllers
Connecting views to outlets in Swift
Calling actions from interface builder
Triggering a segue with code
Passing data with segues
Using Auto Layout
Understanding constraints
Adding constraints
Adding a constraint with drag and drop
Adding constraints to the Press Me scene
Adding missing constraints
Summary
5. Creating Custom Views in Swift
An overview of UIView
Creating new views with Interface Builder
Creating a table view controller
Showing data in the table
Defining a view in a xib file
Wiring a custom view class
Dealing with intrinsic size
Creating new views by subclassing UIView
Auto Layout and custom views
Constraints and the visual format language
Adding the custom view to the table
Custom graphics with drawRect
Drawing graphics in drawRect
Responding to orientation changes
Custom graphics with layers
Creating a ProgressView from layers
Adding the stop square
Adding a progress bar
Clipping the view
Testing views in Xcode
Responding to change
Summary
6. Parsing Networked Data
Loading data from URLs
Dealing with errors
Dealing with missing content
Nested if and switch statements
Networking and user interfaces
Running functions on the main thread
Parsing JSON
Handling errors
Parsing XML
Creating a parser delegate
Downloading the data
Parsing the data
Direct network connections
Opening a stream-based connection
Synchronous reading and writing
Writing data to NSOutputStream
Reading from an NSInputStream
Reading and writing hexadecimal and UTF8 data
Implementing the Git protocol
Listing git references remotely
Integrating the network call into the UI
Asynchronous reading and writing
Reading data asynchronously from an NSInputStream
Creating a stream delegate
Dealing with errors
Listing references asynchronously
Displaying asynchronous references in the UI
Writing data asynchronously to an NSOutputStream
Summary
7. Building a Repository Browser
An overview of the GitHub API
Root endpoint
User resource
Repositories resource
Repository browser project
URI templates
Background threading
Parsing JSON dictionaries
Parsing JSON arrays of dictionaries
Creating the client
Talking to the GitHub API
Returning repositories for a user
Accessing data through the AppDelegate
Accessing repositories from view controllers
Adding users
Implementing the detail view
Transitioning between the master and detail views
Loading the user's avatar
Displaying the user's avatar
Summary
8. Adding Watch Support
Watch applications
Adding a watch target
Adding the GitHubAPI to the watch target
Creating watch interfaces
Adding a list of users to the watch
Wiring up the interface
Adding an image
Responding to user interaction
Adding context and showing repositories
Adding a detail screen
Populating the detail screen
Best practice for watch applications
UI thread considerations
Stored data
Appropriate use of complications and glances
Summary
A. References to Swift-related Websites, Blogs, and Notable Twitter Users
Language
Twitter users
Blogs and tutorial sites
Meetups
Afterword
Index

Swift Essentials Second Edition

Copyright © 2016 Packt Publishing
All rights reserved. No part of this boo...

Table des matiĂšres