Mastering Swift 2

Dive into the latest release of the Swift programming language with this advanced Apple development book for creating exceptional iOS and osX applications

Mastering Swift 2

This ebook is included in a Mapt subscription
Jon Hoffman

1 customer reviews
Dive into the latest release of the Swift programming language with this advanced Apple development book for creating exceptional iOS and osX applications
$0.00
$39.99
$49.99
$29.99p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781785886034
Paperback408 pages

Book Description

At their Worldwide Developer’s conference (WWDC) in 2015, Apple announced Swift 2, a major update to the innovative programming language they first unveiled to the world the year before. Swift 2 features exciting enhancements to the original iteration of Swift, acting, as Apple put it themselves as “a successor to the C and Objective-C languages.” – This book demonstrates how to get the most from these new features, and gives you the skills and knowledge you need to develop dynamic iOS and OS X applications.

Learn how to harness the newest features of Swift 2 todevelop advanced applications on a wide range of platforms with this cutting-edge development guide. Exploring and demonstrating how to tackle advanced topics such as Objective-C interoperability, ARC, closures, and concurrency, you’ll develop your Swift expertise and become even more fluent in this vital and innovative language. With examples that demonstrate how to put the concepts into practice, and design patterns and best practices, you’ll be writing better iOS and OSX applications in with a new level of sophistication and control.

Table of Contents

Chapter 1: Taking the First Steps with Swift
What is Swift?
Playgrounds
Hello World
Summary
Chapter 2: Learning about Variables, Constants, Strings, and Operators
Constants and variables
Operators
Summary
Chapter 3: Using Collections and Cocoa Data Types
Swift collection types
Mutability
Arrays
Dictionaries
Set
Tuples
Using Cocoa data types
Foundation data types
Summary
Chapter 4: Control Flow and Functions
What we have learned so far
Control flow
Functions
Putting it all together
Summary
Chapter 5: Classes and Structures
What are classes and structures?
Creating a class or structure
Custom initializers
Inheritance
Overriding methods and properties
Protocols
Protocol syntax
Extensions
Memory management
Summary
Chapter 6: Using Protocols and Protocol Extensions
Protocols as types
Polymorphism with protocols
Type casting with protocols
Protocol extensions
Summary
Chapter 7: Writing Safer Code with Availability and Error Handling
Error handling prior to Swift 2.0
Error handling in Swift 2
The availability attribute
Summary
Chapter 8: 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 9: 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 10: Using Optional Types
Introducing optionals
The need for optional types in Swift
Optional chaining
Summary
Chapter 11: Working with Generics
An introduction to generics
Generic functions
Generic types
Associated types
Summary
Chapter 12: Working with Closures
An introduction to closures
Simple closures
Shorthand syntax for closures
Using closures with Swift's array algorithms
Standalone closures and good style guidelines
Changing functionality
Selecting a closure based on results
Creating strong reference cycles with closures
Summary
Chapter 13: Using Mix and Match
What is mix and match
Using Swift and Objective-C together in the same project
Summary
Chapter 14: Concurrency and Parallelism in Swift
Concurrency and parallelism
Summary
Chapter 15: Swift Formatting and Style Guide
What is a programming style guide?
Your style guide
Summary
Chapter 16: 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
Checking network connection
RSNetworking2 for Swift 2
Summary
Chapter 17: Adopting Design Patterns in Swift
Value versus reference types
What are design patterns
Creational patterns
Structural design patterns
Behavioral design patterns
Summary

What You Will Learn

  • Dive into the core components of Swift 2 including operators, collections, control flow, and functions
  • Create and use classes, structures, and enums including object-oriented topics such as inheritance, protocols, and extensions
  • Develop a practical understanding of subscripts, optionals, and closures
  • Learn how to use the new protocol extension and error handling features of Swift 2
  • Add concurrency to your applications using Grand Central Dispatch
  • Master 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
Hello World
Summary
Chapter 2: Learning about Variables, Constants, Strings, and Operators
Constants and variables
Operators
Summary
Chapter 3: Using Collections and Cocoa Data Types
Swift collection types
Mutability
Arrays
Dictionaries
Set
Tuples
Using Cocoa data types
Foundation data types
Summary
Chapter 4: Control Flow and Functions
What we have learned so far
Control flow
Functions
Putting it all together
Summary
Chapter 5: Classes and Structures
What are classes and structures?
Creating a class or structure
Custom initializers
Inheritance
Overriding methods and properties
Protocols
Protocol syntax
Extensions
Memory management
Summary
Chapter 6: Using Protocols and Protocol Extensions
Protocols as types
Polymorphism with protocols
Type casting with protocols
Protocol extensions
Summary
Chapter 7: Writing Safer Code with Availability and Error Handling
Error handling prior to Swift 2.0
Error handling in Swift 2
The availability attribute
Summary
Chapter 8: 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 9: 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 10: Using Optional Types
Introducing optionals
The need for optional types in Swift
Optional chaining
Summary
Chapter 11: Working with Generics
An introduction to generics
Generic functions
Generic types
Associated types
Summary
Chapter 12: Working with Closures
An introduction to closures
Simple closures
Shorthand syntax for closures
Using closures with Swift's array algorithms
Standalone closures and good style guidelines
Changing functionality
Selecting a closure based on results
Creating strong reference cycles with closures
Summary
Chapter 13: Using Mix and Match
What is mix and match
Using Swift and Objective-C together in the same project
Summary
Chapter 14: Concurrency and Parallelism in Swift
Concurrency and parallelism
Summary
Chapter 15: Swift Formatting and Style Guide
What is a programming style guide?
Your style guide
Summary
Chapter 16: 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
Checking network connection
RSNetworking2 for Swift 2
Summary
Chapter 17: Adopting Design Patterns in Swift
Value versus reference types
What are design patterns
Creational patterns
Structural design patterns
Behavioral design patterns
Summary

Book Details

ISBN 139781785886034
Paperback408 pages
Read More
From 1 reviews

Read More Reviews