Mastering Swift 3
eBook - ePub

Mastering Swift 3

Jon Hoffman

Compartir libro
  1. 392 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Mastering Swift 3

Jon Hoffman

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

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

About This Book

  • Discover the new features and improvements to Swift 3
  • Get to grips with advanced design patterns and techniques to write smarter, cleaner Swift code
  • Become a more fluent Swift developer and build powerful, impressive iOS and OS X applications.

Who This Book Is For

This book is for developers who want to dive into the newest version of Swift.

If you are a developer that learns best by looking at, and working with code, then this book is for you. A basic understanding of Apple's tools is beneficial but not mandatory.

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

In Detail

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.

Style and approach

Packed with practical examples that show you how to put the concepts you learn into practice quickly, we'll takes you through some of the most advanced and sophisticated elements of the language in a practical and actionable way. You can also download the code to use yourself

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Mastering Swift 3 un PDF/ePUB en línea?
Sí, puedes acceder a Mastering Swift 3 de Jon Hoffman en formato PDF o ePUB, así como a otros libros populares de Informatica y Programmazione di dispositivi mobili. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2016
ISBN
9781786466129

Mastering Swift 3


Mastering Swift 3

Copyright © 2016 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: October 2016
Production reference: 1191016
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78646-612-9
www.packtpub.com

Credits

Author
Jon Hoffman
Copy Editor
Vikrant Phadke
Reviewer
Jannis Muething
Project Coordinator
Shweta H Birwatkar
Commissioning Editor
Ashwin Nair
Proofreader
Safis Editing
Acquisition Editor
Tushar Gupta
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 those 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 the Information Technology field provides and there is nothing more exhilarating to him than overcoming a challenge.
You can follow Jon on his two 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 Reviewer

Jannis Muething works as a freelance developer and designer for mobile applications. He is currently based in Dortmund, Germany and has been developing for mobile devices with a focus on iOS since 2009. Since 2014, he has been working for smartcircles mHealth AG, where he is involved in many projects. Recently he has also been doing security research focused on the protection of private data on mobile devices. Prior to mobile/iOS design and development, he worked at Materna GmbH, where he mainly did Java development. He can be found on the web at http://jannis.co and on Twitter at @j4nnis.

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

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 sorts of app that are essential to iPhone and iPad users every day.

What this book covers

Chapter 1, Taking the First Steps with Swift, shows you how to start and use Playgrounds to experiment with Swift programming. We will also cover the basic Swift language syntax and discuss proper language styles.
Chapter 2, Learning About Variables, Constants, Strings, and Operators, will show 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, will look at how we can use the Swift collection types to store related data. These collection types are the dictionary and array types. We will also look at how we can use the Cocoa and Foundation data types in Swift.
Chapter 4, Control Flow and Functions, will cover 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, is dedicated 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, will cover both protocols and protocol extensions in detail since protocols are very important to the Swift language, and having a solid understanding of them will help us write flexible and reusable code.
Chapter 7, Protocol-Oriented Design, will cover the best practices of Protocol-Oriented Design with Swift. It will be a brief overview of what is covered in my Protocol-Oriented Programming (POP) book.
Chapter 8, Writing Safer Code with Availability and Error Handling, will look 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, 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, will discuss 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 Optional Types, will explain what optional types really are, what the various ways to unwrap them are, and optional chaining. For a developer who is just learning Swift, optional types can be one of the most confusing items to learn.
Chapter 11, Working with Generics, will explain how Swift implements generics. Generics allow us to write very flexible and reusable code that avoids duplication.
Chapter 12, Working with Closures, will teach us how to define and use closures in our code. Closures in Swift are similar to blocks in Objective-C except that they have a much cleaner and easier way of using syntax. We will conclude this chapter with a section on how to avoid strong reference cycles with closures.
Chapter 13, Using Mix and Match, will explain mix and match and demonstrate how we can include Swift code in our Objective-C projects and Objective-C code in our Swift projects. With all of the apps and fram...

Índice