Mastering Swift 3 - Linux

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

Mastering Swift 3 - Linux

Learning
Jon Hoffman

1 customer reviews
Learn to build fast and robust applications on the Linux Platform with Swift
$35.99
$44.99
RRP $35.99
RRP $44.99
eBook
Print + eBook

Instantly access this course right now and get the skills you need in 2017

With unlimited access to a constantly growing library of over 4,000 eBooks and Videos, a subscription to Mapt gives you everything you need to learn new skills. Cancel anytime.

Preview in Mapt

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