Mastering Swift

Master Apple's new Swift programming language by following the best practices to write efficient and powerful code
Preview in Mapt

Mastering Swift

Jon Hoffman

Master Apple's new Swift programming language by following the best practices to write efficient and powerful code
Mapt Subscription
FREE
$29.99/m after trial
eBook
$28.00
RRP $39.99
Save 29%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$28.00
$49.99
$29.99p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Mastering Swift Book Cover
Mastering Swift
$ 39.99
$ 28.00
Swift: Mastering the Core Concepts [Integrated Course] Book Cover
Swift: Mastering the Core Concepts [Integrated Course]
$ 124.99
$ 106.25
Buy 2 for $35.00
Save $129.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781784392154
Paperback358 pages

Book Description

Swift is Apple's new innovative and user-friendly development language, which is packed with modern features to make programming easier, fun, and flexible.

This book begins by giving you a solid Introduction to the Swift programming language so you can quickly begin developing applications using this interesting language. It also covers advanced topics such as Objective-C interoperability, ARC, closures, and concurrency. Each concept covered is backed up with example code and demonstrates how to properly execute it. Next, you will be taught about all of the advanced features of Swift, and its interaction with Apple's APIs and libraries. You'll then learn to interact with REST-based web services using Swift. We will conclude the book by getting equipped to design and build applications using established design patterns.

Table of Contents

Chapter 1: Taking the First Steps with Swift
What is Swift?
Playgrounds
Swift language syntax
Hello world
Summary
Chapter 2: Learning about Variables, Constants, Strings, and Operators
Constants and variables
Defining constants and variables
Numeric types
The Boolean type
The string type
Optional variables
Enumerations
Operators
Summary
Chapter 3: Using Collections and Cocoa Data Types
Swift collection types
Mutability
Arrays
Dictionaries
Tuples
Using Cocoa data types
Foundation data types
Summary
Chapter 4: Control Flow and Functions
What we have learned so far
Control flow
Functions
Summary
Chapter 5: Classes and Structures
What are classes and structures?
Creating a class or structure
Initializer
Inheritance
Overriding methods and properties
Protocols
Extensions
Memory management
Summary
Chapter 6: Working with XML and JSON Data
XML and JSON
Common files
XML and the NSXMLParser class
Using the NSXMLParserDelegate protocol
Parsing XML documents
XML and manually building XML documents
JSON and NSJSONSerialization
Summary
Chapter 7: Custom Subscripting
Introducing subscripts
Subscripts with Swift arrays
Read and write custom subscripts
Read only custom subscripts
Calculated subscripts
Subscript values
Subscripts with ranges
External names for subscripts
Multidimensional subscripts
When not to use a custom subscript
Summary
Chapter 8: Using Optional Type and Optional Chaining
Introducing optionals
The need for optional types in Swift
Optional chaining
Summary
Chapter 9: Working with Generics
Introduction to generics
Generic functions
Generic types
Associated types
Summary
Chapter 10: Working with Closures
Introducing closures
Simple closures
Shorthand syntax for closures
Using closures with Swift's array algorithms
Standalone closures and good style guidelines
Changing functionality
Select a closure based on results
Strong reference cycles with closures
Summary
Chapter 11: Using Mix and Match
What is mix and match?
Using Swift and Objective-C together in the same project
Summary
Chapter 12: Concurrency and Parallelism in Swift
Concurrency and parallelism
Summary
Chapter 13: Swift Formatting and Style Guide
What is a programming style guide?
Your style guide
Summary
Chapter 14: Network Development with Swift
What is network development?
An overview of the URL session classes
REST web services
Making an HTTP GET request
Making an HTTP POST request
Encoding a URL
Checking network connection
RSNetworking
Summary
Chapter 15: Adopting Design Patterns in Swift
What are design patterns?
Creational patterns
Structural design patterns
Behavioral design patterns
Summary

What You Will Learn

  • Prototype and test code in a Playground
  • Understand the basics of Swift, including operators, collections, control flows, and functions
  • Create and use Classes, Structures, and Enums, including object-oriented topics such as inheritance, protocols, and Extensions
  • Dwell into Subscripts, Optionals, and closures with real-world scenarios
  • Employ Grand Central Dispatch to add concurrency to your applications
  • Study the Objective-C interoperability with mix and match
  • Access network resources using Swift
  • Implement various standard design patterns in the Swift language

Authors

Table of Contents

Chapter 1: Taking the First Steps with Swift
What is Swift?
Playgrounds
Swift language syntax
Hello world
Summary
Chapter 2: Learning about Variables, Constants, Strings, and Operators
Constants and variables
Defining constants and variables
Numeric types
The Boolean type
The string type
Optional variables
Enumerations
Operators
Summary
Chapter 3: Using Collections and Cocoa Data Types
Swift collection types
Mutability
Arrays
Dictionaries
Tuples
Using Cocoa data types
Foundation data types
Summary
Chapter 4: Control Flow and Functions
What we have learned so far
Control flow
Functions
Summary
Chapter 5: Classes and Structures
What are classes and structures?
Creating a class or structure
Initializer
Inheritance
Overriding methods and properties
Protocols
Extensions
Memory management
Summary
Chapter 6: Working with XML and JSON Data
XML and JSON
Common files
XML and the NSXMLParser class
Using the NSXMLParserDelegate protocol
Parsing XML documents
XML and manually building XML documents
JSON and NSJSONSerialization
Summary
Chapter 7: Custom Subscripting
Introducing subscripts
Subscripts with Swift arrays
Read and write custom subscripts
Read only custom subscripts
Calculated subscripts
Subscript values
Subscripts with ranges
External names for subscripts
Multidimensional subscripts
When not to use a custom subscript
Summary
Chapter 8: Using Optional Type and Optional Chaining
Introducing optionals
The need for optional types in Swift
Optional chaining
Summary
Chapter 9: Working with Generics
Introduction to generics
Generic functions
Generic types
Associated types
Summary
Chapter 10: Working with Closures
Introducing closures
Simple closures
Shorthand syntax for closures
Using closures with Swift's array algorithms
Standalone closures and good style guidelines
Changing functionality
Select a closure based on results
Strong reference cycles with closures
Summary
Chapter 11: Using Mix and Match
What is mix and match?
Using Swift and Objective-C together in the same project
Summary
Chapter 12: Concurrency and Parallelism in Swift
Concurrency and parallelism
Summary
Chapter 13: Swift Formatting and Style Guide
What is a programming style guide?
Your style guide
Summary
Chapter 14: Network Development with Swift
What is network development?
An overview of the URL session classes
REST web services
Making an HTTP GET request
Making an HTTP POST request
Encoding a URL
Checking network connection
RSNetworking
Summary
Chapter 15: Adopting Design Patterns in Swift
What are design patterns?
Creational patterns
Structural design patterns
Behavioral design patterns
Summary

Book Details

ISBN 139781784392154
Paperback358 pages
Read More

Read More Reviews

Recommended for You

Swift Essentials Book Cover
Swift Essentials
$ 29.99
$ 21.00
Mastering Swift 2 Book Cover
Mastering Swift 2
$ 39.99
$ 28.00
Swift 2 Blueprints Book Cover
Swift 2 Blueprints
$ 35.99
$ 25.20
Mastering Object-oriented Python Book Cover
Mastering Object-oriented Python
$ 26.99
$ 18.90
Swift Cookbook Book Cover
Swift Cookbook
$ 39.99
$ 28.00
Software Testing using Visual Studio 2012 Book Cover
Software Testing using Visual Studio 2012
$ 29.99
$ 21.00