Mastering Swift 3

Dive into the latest release of the Swift programming language with this advanced Apple development book

Mastering Swift 3

This ebook is included in a Mapt subscription
Jon Hoffman

4 customer reviews
Dive into the latest release of the Swift programming language with this advanced Apple development book
$0.00
$18.00
$44.99
$29.99p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
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
 
Preview in Mapt

Book Details

ISBN 139781786466129
Paperback392 pages

Book Description

Swift is the definitive language of Apple development today. It’s a vital part of any iOS and OS X developer’s skillset, helping them to build the most impressive and popular apps on the App Store—the sort of apps that are essential to iPhone and iPad users every day. With version 3.0, the Swift team have added new features to improve the development experience—making it easier to get the results you want and customers expect.

Inside, you’ll find the key features of Swift 3.0 and quickly learn how to use the newest updates to your development advantage. From Objective-C interoperability to ARC, to closures and concurrency, this advanced Swift guide will develop your expertise and make you more fluent in this vital programming language.

We give you in-depth knowledge of some of the most sophisticated elements of Swift development including protocol extensions, error-handling, design patterns, and concurrency, and guide you on how to use and apply them in your own projects. You'll see how even the most challenging design patterns and programming techniques can be used to write cleaner code and to build more performant iOS and OS X applications.

By the end of this book, you’ll have a handle on effective design patterns and techniques, which means you’ll soon be writing better iOS and OS X applications 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 Swift Collections and the Tuple Type
Swift collection types
Mutability
Arrays
Dictionaries
Set
Tuples
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: Protocol-Oriented Design
Requirements
Object-Oriented design
Summary
Chapter 8: Writing Safer Code with Availability and Error Handling
Error handling prior to Swift 2.0
Native error handling
The availability attribute
Summary
Chapter 9: Custom Subscripting
Introducing subscripts
Subscripts with Swift arrays
Read and write custom subscripts
Read-only custom subscripts
Calculated subscripts
Subscript values
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
When not to use generics
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?
When to use 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: Swifts Core Libraries
Apple's URL loading system
Formatter
Summary
Chapter 17: Adopting Design Patterns in Swift
What are design patterns?
Creational patterns
Structural design patterns
Behavioral design patterns
Summary

What You Will Learn

  • Dive into the core components of Swift 3.0, including operators, collections, control flow, and functions
  • Create and use classes, structures, and enums
  • Understand object-oriented Swift and see how to tackle inheritance, protocols, and extensions
  • Develop a practical understanding of subscripts, optionals, and closures
  • See how to use the new protocol extension and error handling features of Swift 3.0
  • Add concurrency to your applications using Grand Central Dispatch

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 Swift Collections and the Tuple Type
Swift collection types
Mutability
Arrays
Dictionaries
Set
Tuples
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: Protocol-Oriented Design
Requirements
Object-Oriented design
Summary
Chapter 8: Writing Safer Code with Availability and Error Handling
Error handling prior to Swift 2.0
Native error handling
The availability attribute
Summary
Chapter 9: Custom Subscripting
Introducing subscripts
Subscripts with Swift arrays
Read and write custom subscripts
Read-only custom subscripts
Calculated subscripts
Subscript values
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
When not to use generics
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?
When to use 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: Swifts Core Libraries
Apple's URL loading system
Formatter
Summary
Chapter 17: Adopting Design Patterns in Swift
What are design patterns?
Creational patterns
Structural design patterns
Behavioral design patterns
Summary

Book Details

ISBN 139781786466129
Paperback392 pages
Read More
From 4 reviews

Read More Reviews