23,92 €
Swift greatly simplifies the process of developing applications for Apple devices. This book provides you with the essential skills to help you get started with developing applications using Swift.
Key Features
Book Description
Take your first foray into programming for Apple devices with Swift.Swift is fundamentally different from Objective-C, as it is a protocol-oriented language. While you can still write normal object-oriented code in Swift, it requires a new way of thinking to take advantage of its powerful features and a solid understanding of the basics to become productive.
What you will learn
Who this book is for
If you are seeking fundamental Swift programming skills, in preparation for learning to develop native applications for iOS or macOS, this book is the best for you. You don't need to have any prior Swift knowledge; however, object-oriented programming experience is desired.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 200
Veröffentlichungsjahr: 2018
Copyright © 2018 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 authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been 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.
Acquisition Editor: Aditya Date
Content Development Editor: Taabish Khan
Production Coordinator: Vishal Pawar
First published: May 2018
Production reference: 1310518
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78953-431-3
www.packtpub.com
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
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.
Rob Kerr is a mobile software architect based in United States. He has been working professionally with Swift since its introduction, delivering applications to the public App Store and through enterprise distribution. His current focus is developing state-of-the-art iOS applications using Swift in the IoT space.
Kåre Morstøl is an independent software developer from Norway, with a bachelor's degree in software development. He has programmed almost exclusively in Swift since it was announced. He thinks it's a great language that is continually getting better.
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Swift is a multi-paradigm language. It has expressive features familiar to those used to working with modern functional languages, whilst also keeping the object-oriented features of Objective-C. Swift vastly streamlines the developer experience, and Apple's Xcode playground is a real game-changer.
The book begins by teaching you the basic syntax and structure of Swift, and how to correctly structure and architect software using Swift. It then builds expertise in the core Swift standard library you will need to understand to complete real-world Swift programming projects. We will work through concepts such as operators, branching and loop structures, functions, classes, structs, collections, and strings. We end the book with a brief look at functional programming and lazy operations.
After reading and understanding this book, you will be well-prepared to begin developing native end-user applications for iOS or macOS, or to develop server-side (backend) application and web services using Swift on Linux.
Lesson 1, Swift Basics, covers the fundamentals of using the Swift programming language. In this lesson, you'll learn basic Swift syntax and program structure. You'll also learn how to use Swift built-in data types and enums, and how to declare and use Swift variables and constants.
Lesson 2, Swift Operators and Control Flow, shows you how to use the fundamental flow control structures and language elements that form the building blocks of Swift programs. We will specifically cover operators, branching statements, and loops in this lesson.
Lesson 3, Functions, Classes, and Structs, teaches you how to develop fully featured Swift functions, catch unexpected errors, and use asynchronous programming paradigms. You'll learn how to create your own data types, and create object-oriented applications using classes and structs.
Lesson 4, Collections, shows you how to work with Swift's collections, such as arrays, sets, and dictionaries.
Lesson 5, Strings, covers Swift strings in detail. We will create and use strings and substrings, and see the various common operations available for strings.
Lesson 6, Functional Programming and Lazy Operations, ventures at functional programming and explains what lazy operations are. We will end this lesson with an important but often overlooked topic—writing Swifty code.
This book will require the following hardware:
Please ensure you have the following software installed on your machine:
This book is ideal for developers seeking fundamental Swift programming skills, in preparation for learning to develop native applications for iOS or macOS. No prior Swift knowledge is expected but object-oriented programming experience is desirable.
You should have basic working knowledge of computer programming in a procedural/object-oriented language, such as Objective-C, BASIC, C++, Python, Java, or JavaScript.
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 from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. 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.
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.
Swift is a relatively new programming language designed by Apple Inc., and was initially made available to Apple developers in 2014—primarily intended as a replacement for the aging Objective-C language that was the foundation of OS X and iOS software development at the time.
Unlike many object-oriented languages, which are based on older procedural languages—for example, C++ and Objective-C are based on C—Swift was designed from the ground up as a new, modern, object-oriented language that makes programming faster and easier, and helps developers produce expressive code that's less prone to errors than many languages.
While not based on an older language, Swift, in the words of its chief architect, Chris Lattner, "was inspired by drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list." (Chris Lattner home page: http://nondot.org/sabre/).
Swift was initially a proprietary language, but was made open source software in December 2015 as of its version 2.2. While Swift remains primarily used by developers targeting the Apple macOS and iOS platforms, Swift is also fully supported on Linux, and there are unofficial ports under development for Windows as well.
The objective of this lesson is to learn the fundamentals of using the Swift programming language. In this lesson, you'll learn basic Swift syntax and program structure. You'll also learn how to use Swift built-in data types and enums, and how to declare and use Swift variables and constants. Let's get started.
By the end of this lesson, you will be able to:
