Mastering Swift 3 - Linux
eBook - ePub

Mastering Swift 3 - Linux

Jon Hoffman

Share book
  1. 380 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering Swift 3 - Linux

Jon Hoffman

Book details
Book preview
Table of contents
Citations

About This Book

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

About This Book

  • Create robust applications by building a strong foundation in the Swift Language
  • Utilize Swift 3 on the embedded Linux platform for IoT and Robotic projects
  • Build more flexible and high-performing applications on desktop, server, and embedded Linux platforms

Who This Book Is For

This book is for Linux developers who are interested in quickly learning how to use Swift to create exciting applications on Linux platforms.

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

In Detail

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.

Style and approach

This easy-to-follow, code-rich guide is filled with examples that demonstrate how to put the concepts into practice. You'll also get design patterns and best practices to get you writing better applications on the Linux platform.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Mastering Swift 3 - Linux an online PDF/ePUB?
Yes, you can access Mastering Swift 3 - Linux by Jon Hoffman in PDF and/or ePUB format, as well as other popular books in Informatica & Programmazione di dispositivi mobili. We have over one million books available in our catalogue for you to explore.

Information

Year
2017
ISBN
9781786461414

Mastering Swift 3 - Linux


Mastering Swift 3 - Linux

Copyright Š 2017 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2017
Production reference: 1281216
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78646-141-4
www.packtpub.com

Credits

Author
Jon Hoffman
Copy Editor
Safis Editing
Reviewers
Andrea Prearo
Doug Sparling
Project Coordinator
Shweta H Birwatkar
Commissioning Editor
Ashwin Nair
Proofreader
Safis Editing
Acquisition Editor
Smeet Thakkar
Indexer
Aishwarya Gangawane
Content Development Editor
Sumeet Sawant
Graphics
Disha Haria
Technical Editor
Egan Lobo
Production Coordinator
Nilesh Mohite

About the Author

Jon Hoffman has over 20 years of experience in the field of information technology. Over these 20 years, Jon has worked in the areas of system administration, network administration, network security, application development, and architecture. Currently, Jon works as a senior software engineer for Syn-Tech Systems.
Jon has developed extensively for the iOS platform since 2008. This includes several apps that he has published in the App Store, apps that he has written for third parties, and numerous enterprise applications. What really drives Jon is the challenges that the field of information technology provides and there is nothing more exhilarating to him than overcoming a challenge.
You can follow Jon on his blogs: http://masteringswift.blogspot.com and http://myroboticadventure.blogspot.com.
Some of Jon’s other interests are watching baseball (Go Sox) and basketball (Go Celtics). Jon also really enjoys Tae Kwon Do where he and his oldest daughter Kailey earned their black belts together early in 2014, Kim (his wife) earned her black belt in December 2014, and his youngest daughter is currently working towards her black belt.
I would like to thank my wonderful wife, Kim, without whose support, encouragement, patience, and understanding, this book would have never been written. I would also like to thank my two wonderful daughters, Kailey and Kara, who have both been my inspiration and driving force since the days they were born.

About the Reviewers

Andrea Prearo is a software engineer with over 15 years of experience.
He is originally from Italy, and after a decade of writing software in C/C++ and C#, he moved to the Bay Area in 2011 to start developing mobile apps.
In the last few years, he has been focusing on Swift, Objective-C, iOS, and microservices, with some short explorations of the Android platform.
Currently, he is a member of the iOS development team at Capital One, working on the company’s flagship mobile banking app.
His interests include reading books, watching movies, and hiking. From time to time, he also blogs about tech on Medium: https://medium.com/@andrea.prearo.
I would like to thank my wonderful wife, Nicole, for her never-ending support in all my endeavors.
Doug Sparling works as a technical architect and software developer for Andrews McMeel Universal, a publishing and syndication company in Kansas City, MO. At AMU, he uses Go for web services, Python for backend services, and Ruby on Rails and WordPress for website development, and Objective-C, Swift, and Java for native iOS and Android development. AMU’s sites include www.gocomics.com, www.uexpress.com, www.puzzlesociety.com, and dilbert.com.
He also was the co-author of a Perl book, Instant Perl Modules for McGraw-Hill and a reviewer for other Packt Publishing books, including Swift Data Structure and Algorithms, jQuery 2.0 Animation Techniques: Beginner’s Guide, and WordPress Web Application Development. Doug has also played various roles for Manning Publications as a reviewer, technical development editor, and proofer, working on books such as Go in Action, The Well-Grounded Rubyist 2nd Edition, iOS Development with Swift, and Programming for Musicians and Digital Artists.

www.PacktPub.com

For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
www.PacktPub.com
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.

Why subscribe?

  • Fully searchable across every book published by Packt
  • Copy and paste, print, and bookmark content
  • On demand and accessible via a web browser

Preface

In December 2015, Apple released Swift as an open source project on its GitHub page. With this release, Apple also released a version of Swift for Linux. Swift is a general-purpose programming language that takes a modern approach to development.

What this book covers

Chapter 1, Taking the First Steps with Swift, gives a brief introduction to the Swift language. We will also cover the basic Swift language syntax and discuss proper language styles.
Chapter 2, Learning About Variables, Constants, Strings, and Operators, shows how to use variables and constants in Swift. We will also look at the various data types and how to use operators in Swift.
Chapter 3, Using Swift Collections and the Tuple Type, looks at how we can use the Swift collection types to store related data. These collection types are the dictionary, array and set types.
Chapter 4, Control Flow and Functions, covers control flow and functions in Swift. It is essential to understand the concepts in this chapter before going on. Every application that we write, beyond the simple Hello World applications, will rely very heavily on the control flow statements and functions.
Chapter 5, Classes and Structures, dedicates itself to Swift's classes and structures. We'll look at what makes them similar and what makes them different. We'll also look at access controls and object-oriented design. We'll close this chapter out by looking at memory management in Swift.
Chapter 6, Using Protocols and Protocol Extensions, covers both protocols and protocol extensions in detail since protocols are very important to the Swift language. Having a solid understanding of them will help us write flexible and reusable code.
Chapter 7, Protocol-Oriented Design, covers the best practices of protocol-oriented Design with Swift. It will be a brief overview of what is covered in my Swift 3 Protocol-Oriented Programming book.
Chapter 8, Writing Safer Code with Error Handling, looks at Swift's error-handling features. This feature is really important for writing safe code. While we are not required to use this feature in our custom types however it does give us a uniform manner to handle and respond to the error. Apple has also started to use this error handling in their frameworks. It is recommended that we use error handling in our code.
Chapter 9, Custom Subscripting, discusses how we can use custom subscripts in our classes, structures, and enumerations. Subscripts in Swift can be used to access elements in a collection. We can also define custom subscripts for our classes, structures, and enumerations.
Chapter 10, Using Opti...

Table of contents