39,59 €
Create robust and extensible iOS apps using the advanced features of Swift 2
This book is ideal for those who want to learn to develop app in Swift, starting the right way. Whether you are an expert Objective-C programmer or are new to this platform, you'll quickly grasp the code of real world apps, and discover how to use Swift effectively. Prior experience in development for Apple devices would be helpful, but is not mandatory.
Swift is no longer the unripe language it was when launched by Apple at WWDC14, now it's a powerful and ready-for-production programming language that has empowered most new released apps.
Swift is a user-friendly language with a smooth learning curve; it is safe, robust, and really flexible.
Swift 2 is more powerful than ever; it introduces new ways to solve old problems, more robust error handling, and a new programming paradigm that favours composition over inheritance.
Swift 2 by Example is a fast-paced, practical guide to help you learn how to develop iOS apps using Swift. Through the development of seven different iOS apps and one server app, you'll find out how to use either the right feature of the language or the right tool to solve a given problem.
We begin by introducing you to the latest features of Swift 2, further kick-starting your app development journey by building a guessing game app, followed by a memory game. It doesn't end there, with a few more apps in store for you: a to-do list, a beautiful weather app, two games: Flappy Swift and Cube Runner, and finally an ecommerce app to top everything off.
By the end of the book, you'll be able to build well-designed apps, effectively use AutoLayout, develop videogames, and build server apps.
These easy-to-follow tutorials show you how to build real-world apps. The difficulty and complexity level increases chapter by chapter. Each chapter is dedicated to build a new app, beginning from a basic and unstyled app through to a full 3D game. The last two chapters show you how to build a complete client-server ecommerce app right from scratch.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 282
Veröffentlichungsjahr: 2016
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: March 2016
Production reference: 1080316
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78588-292-0
www.packtpub.com
Author
Giordano Scalzo
Reviewer
Hugo Solis
Commissioning Editor
Veena Pagare
Acquisition Editor
Reshma Raman
Content Development Editor
Divij Kotian
Technical Editor
Vishal Mewada
Copy Editor
Stuti Srivastava
Project Coordinator
Nikhil Nair
Proofreader
Safis Editing
Indexer
Tejal Daruwale Soni
Production Coordinator
Manu Joseph
Cover Work
Manu Joseph
Giordano Scalzo is a developer with 20 years of programming experience, since the days of the ZXSpectrum.
He has worked in C++, Java, .Net, Ruby, Python, and in so many other programming languages he has forgotten the names.
After years of backend development, over the past 5 years Giordano has developed extensively for iOS, releasing more than 20 apps—apps that he wrote for clients, enterprise applications, or on his own.
Currently, he is a contractor in London, where—through his company, Effective Code Ltd, http://effectivecode.co.uk—he delivers code for iOS, aiming at quality and reliability.
In his spare time, when he is not crafting retro game clones for iOS, he writes his thoughts at http://giordanoscalzo.com.
I'd like to thank my better half, Valentina, who lovingly supports me in everything I do: without you, none of this would have been possible.
Thanks to my bright future, Mattia and Luca, for giving me lots of smiles and hugs when I needed them.
Finally, my gratitude goes to my Mum and Dad, who gave my curiosity the right push, along with the support to follow my passions, which began the day they bought me a ZXSpectrum.
Hugo Solis is an assistant professor in the Physics department at the University of Costa Rica. His current research interests are computational cosmology, complexity and the influence of hydrogen on material properties. He has wide experience with languages including C/C++ and Python for scientific programming and visualization. He is a member of the Free Software Foundation, and he has contributed code to some free software projects. He has also been a technical reviewer for Mastering Object-oriented Python, Learning Object-oriented Programming, and Kivy: Interactive Applications in Python and is the author of Kivy Cookbook, Packt Publishing. Currently, he is in charge of the Institute of Food Technologists, a Costa Rican scientific nonprofit organization for the multidisciplinary practice of Physics (http://iftucr.org).
I'd like to thank Katty Sanchez, my beloved mother, for her support and cutting-edge thoughts.
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.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
The introduction of Swift during WWDC 2014 surprised the whole community of iOS developers, who were waiting to be introduced to the new API from iOS 8, not to be transformed into beginners.
Besides the surprise, most of them understood that this would have been a great opportunity to create a new world of libraries, patterns, best practices, and so on. On the other hand, communities of programmers in different languages, who were intimidated by the rough first impact of Objective-C, started to be attracted by Swift, which—with its friendly syntax—was less intimidating.
After a year, Swift 2.0 has proven to be a huge improvement over the first version, enriched by a lot of new features and strengthened by its use in thousands of new apps. It is finally ready for production!
In WWDC 2015, Apple made another surprising announcement: Swift will be open source and there will be versions for different operating systems, beginning with Linux and Windows. This opens up a whole new scenario, where it will be possible to implement both client and the server apps with the same language.
This book will introduce you the world of app development using the new features in Swift 2, and it will show you how to build Linux apps in Swift in order to create server counterparts of your mobile apps.
Through simple step-by-step chapters, the book will teach you how to build both utility and game apps; while building them, you'll learn the basics of Swift and iOS.
Chapter 1, Welcome to the World of Swift, introduces the Swift syntax and the most important features provided by the language.
Chapter 2, Building a Guess the Number App, introduces Xcode, its project file, and the different editors required to build an app; a simple game app will be created to demonstrate these.
Chapter 3, A Memory Game in Swift, shows the creation of a complete game app, with images and animations, without using any Game framework but with only the fundamental iOS libraries.
Chapter 4, A TodoList App in Swift, teaches you how to create a real-world utility app, handling the library dependencies with Cocoapods.
Chapter 5, A Pretty Weather App, shows you how to create a nice looking app that retrieves data from third-party servers.
Chapter 6, Flappy Swift, covers SpriteKit, the 2D iOS game engine.
Chapter 7, Polishing Flappy Swift, completes the game, adding Game Center support and various entertaining touches.
Chapter 8, Cube Runner, covers SceneKit and 3D programming, implementing a 3D endless runner with a space theme.
Chapter 9, Completing Cube Runner, finalizes the game and adds Game Center support.
Chapter 10, ASAP – an E-commerce App in Swift, implements an ecommerce app that uses local storage to store the products.
Chapter 11, ASAPServer, a Server in Swift, is a follow-up to the previous chapter, where we'll implement a backend server for Linux to handle the requests of the ASAP e-commerce app.
In order to get the most out of this book, there are a few essentials you will need:
This book is ideal for those who want to learn how to develop apps in Swift, starting the right way. Whether you are an expert Objective-C programmer or are new to this platform, you'll quickly grasp the code for real-world apps and discover how to use Swift effectively. Prior experience in the development of Apple devices would be helpful, but it is not mandatory.
Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <[email protected]>, and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
You can download the code files by following these steps:
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from http://www.packtpub.com/sites/default/files/downloads/Swift2byExample_ColorImages.pdf.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at <[email protected]>, and we will do our best to address the problem.
