Home Page Icon
Home Page
Table of Contents for
Blogs and tutorial sites
Close
Blogs and tutorial sites
by Dr. Alex Blewitt
Swift Essentials
Swift Essentials
Table of Contents
Swift Essentials
Credits
About the Author
Acknowledgments
About the Reviewers
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
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
Anonymous arguments
Multiple return values and arguments
Returning structured values
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 QuickLook
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 new documentation section
Styling the documentation
Adding resources to a playground
Additional entries in the header
Generating playgrounds automatically
Markdown
AsciiDoc
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 the drag and drop method
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 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 connection
Synchronous reading and writing
Writing data to an 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
The root endpoint
The user resource
The repositories resource
The RepositoryBrowser 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
A. Appendix
Language
Twitter users
Blogs and tutorial sites
Meetups
Afterword
Index
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
Twitter users
Next
Next Chapter
Meetups
Blogs and tutorial sites
https://developer.apple.com/swift/blog/
: This is the
official Apple Swift blog
http://airspeedvelocity.net
: This is the blog
for
@AirspeedSwift
http://alblue.bandlem.com/Tag/swift/
: This is the
author's blog on
Swift
http://mikeabdullah.net
: This is Mike Abdullah's blog
http://mikeash.com
: Here, you can find the Friday Q&A series on all things iOS and OSX
http://natecook.com/blog/tags/swift/
: This is Nate
Cook's blog on Swift
http://nshipster.com
: This is the blog for
@NSHipster
http://objc.io
: This is the blog
for
@objcio
http://practicalswift.com
: This is collected by
@PracticalSwift
http://sketchytech.blogspot.co.uk
: This
is a collected blog of Swift articles by
@SketychTech
http://swiftnews.curated.co
: This is
collected by
@NatashaTheRobot
http://www.cimgf.com
: This presents a collection of topics on Cocoa, by Marcus S Zarra and others
http://www.raywenderlich.com
: This has a collection of tutorials about iOS development, including both Cocoa and Swift
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