Mastering Swift 3 - Linux

Learn to build fast and robust applications on the Linux Platform with Swift
Preview in Mapt

Mastering Swift 3 - Linux

Jon Hoffman

1 customer reviews
Learn to build fast and robust applications on the Linux Platform with Swift
Mapt Subscription
FREE
$29.99/m after trial
eBook
$25.20
RRP $35.99
Save 29%
Print + eBook
$44.99
RRP $44.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
$25.20
$44.99
$29.99p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Mastering Swift 3 - Linux Book Cover
Mastering Swift 3 - Linux
$ 35.99
$ 25.20
Swift 3 Object-Oriented Programming - Second Edition Book Cover
Swift 3 Object-Oriented Programming - Second Edition
$ 31.99
$ 22.40
Buy 2 for $35.00
Save $32.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 139781786461414
Paperback380 pages

Book Description

Swift is a modern, fast, and safe programming language created by Apple. Writing Swift is interactive and fun, the syntax is concise yet expressive, and the code runs lightning-fast. Swift’s move to open source has been embraced with open arms and has seen increased adoption in the Linux platform.

Our book will introduce you to the Swift language, further delving into all the key concepts you need to create applications for desktop, server, and embedded Linux platforms. We will teach you the best practices to design an application with Swift 3 via design patterns and Protocol-Oriented Programming.

Further on, you will learn how to catch and respond to errors within your application. When you have gained a strong knowledge of using Swift in Linux, we’ll show you how to build IoT and robotic projects using Swift on single board computers. By the end of the book, you will have a solid understanding of the Swift Language with Linux and will be able to create your own applications with ease.

Table of Contents

Chapter 1: Taking the First Steps with Swift
What is Swift?
Hello World
Executing Swift code
Swift and the Swift REPL
Swift compiler
Using the Swift Package Manger
Editors for Swift
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
Protocol-oriented design
Summary
Chapter 8: Writing Safer Code with Error Handling
Error handling prior to Swift 2.0
Native error handling
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
Summary
Chapter 12: Working with Closures
An introduction to closures
Simple closures
Shorthand syntax for closures
Using closures with Swift's array algorithms
Changing functionality
Selecting a closure based on results
Creating strong reference cycles with closures
Summary
Chapter 13: Using C Libraries with Swift
Modules
Creating a custom module
Creating the Cpcap module
Using the Cpcap module
Linux man pages
Summary
Chapter 14: Concurrency and Parallelism in Swift
Concurrency and parallelism
Summary
Chapter 15: Swifts Core Libraries
Apple's URL loading system
Formatter
Summary
Chapter 16: Swift on Single Board Computers
The BeagleBone Black
BeagleBone Black's expansion headers
Installing Swift
SwiftyBones3
Sources directory
SwiftyBuild
Blinking an LED with the SBDigitalGPIO type
TMP36 temperature sensor with the SBAnalog type
Autonomous robot
Summary
Chapter 17: Swift Formatting and Style Guide
What is a programming style guide?
Your style guide
Summary
Chapter 18: Adopting Design Patterns in Swift
What are design patterns?
Creational patterns
Structural design patterns
Behavioral design patterns
Summary

What You Will Learn

  • Install Swift on the Linux platform
  • Explore the power of the Swift language
  • Get to know the proper design techniques
  • Understand Swift’s new Core Library
  • Implement popular design patterns with Swift
  • Integrate C libraries with Swift
  • Using Swift on Single-Board Computers
  • Learn how to add concurrency to your application with Grand Central Dispatch
  • Learn how to work with Swift Generics
  • Learn how to use the Protocol-Oriented design paradigm

Authors

Table of Contents

Chapter 1: Taking the First Steps with Swift
What is Swift?
Hello World
Executing Swift code
Swift and the Swift REPL
Swift compiler
Using the Swift Package Manger
Editors for Swift
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
Protocol-oriented design
Summary
Chapter 8: Writing Safer Code with Error Handling
Error handling prior to Swift 2.0
Native error handling
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
Summary
Chapter 12: Working with Closures
An introduction to closures
Simple closures
Shorthand syntax for closures
Using closures with Swift's array algorithms
Changing functionality
Selecting a closure based on results
Creating strong reference cycles with closures
Summary
Chapter 13: Using C Libraries with Swift
Modules
Creating a custom module
Creating the Cpcap module
Using the Cpcap module
Linux man pages
Summary
Chapter 14: Concurrency and Parallelism in Swift
Concurrency and parallelism
Summary
Chapter 15: Swifts Core Libraries
Apple's URL loading system
Formatter
Summary
Chapter 16: Swift on Single Board Computers
The BeagleBone Black
BeagleBone Black's expansion headers
Installing Swift
SwiftyBones3
Sources directory
SwiftyBuild
Blinking an LED with the SBDigitalGPIO type
TMP36 temperature sensor with the SBAnalog type
Autonomous robot
Summary
Chapter 17: Swift Formatting and Style Guide
What is a programming style guide?
Your style guide
Summary
Chapter 18: Adopting Design Patterns in Swift
What are design patterns?
Creational patterns
Structural design patterns
Behavioral design patterns
Summary

Book Details

ISBN 139781786461414
Paperback380 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Mastering Swift 2 Book Cover
Mastering Swift 2
$ 39.99
$ 28.00
Mastering iOS 10 Programming Book Cover
Mastering iOS 10 Programming
$ 39.99
$ 28.00
Reactive Programming with Swift Book Cover
Reactive Programming with Swift
$ 35.99
$ 25.20
Swift 3 Protocol-Oriented Programming - Second Edition Book Cover
Swift 3 Protocol-Oriented Programming - Second Edition
$ 31.99
$ 22.40
Swift 2 Blueprints Book Cover
Swift 2 Blueprints
$ 35.99
$ 25.20
Mastering Web Application Development with AngularJS Book Cover
Mastering Web Application Development with AngularJS
$ 26.99
$ 5.40