Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Swift 4 Programming Cookbook

You're reading from   Swift 4 Programming Cookbook 50 task-oriented recipes to maximise Swift 4 productivity

Arrow left icon
Product type Paperback
Published in Sep 2017
Publisher Packt
ISBN-13 9781786460899
Length 384 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Keith Moon Keith Moon
Author Profile Icon Keith Moon
Keith Moon
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Swift Building Blocks FREE CHAPTER 2. Building on the Building Blocks 3. Data Wrangling with Swift Control Flow 4. Generics, Operators, and Nested Types 5. Beyond the Standard Library 6. Swift Playgrounds 7. Server-Side Swift 8. Performance and Responsiveness in Swift

What this book covers

Chapter 1, Swift Building Blocks, introduces you to the basic building blocks of Swift 4, its syntax, and the functionalities of basic Swift constructs. Also, this chapter will introduce you to Apple’s Xcode 9 IDE and Swift Playgrounds, which provide an ideal way to create, execute, debug, and understand the recipes contained in this book, thus setting you up to initiate the development process. In this chapter, learn to write your first Swift program and understand the various basic elements of the Swift language.

Chapter 2, Building on the Building Blocks, teaches the reader to create more complex structures on the basis of the building blocks that you studied in the first chapter and the functionalities provided by the Swift standard library. You will get an understanding of how to bundle the variables into tuples, order the data with the help of an array, and store key-value pairs with Dictionaries. Also, you can learn to use the property observers and control the access to and visibility of your code. Then, you will also learn to extend the functionalities of your codes using the extensions.

Chapter 3, Data Wrangling with Swift Control Flow, says that programming is all about making decisions; therefore, this chapter explores how to make a decision on the basis of information gained and how to alter the control flow of the code. You can learn how to conditionally execute code with if/else statements, control the flow of execution of your code with switch statements, and then loop the code by understanding how to use the for and while loops. Then, you will understand how to handle Swift errors with the try, throw, do, and catch statements, and also how a defer statement can be useful to change state once a function's execution is complete or to clean up values that are no longer needed.

Chapter 4, Generics, Operators, and Nested Types, provides you with an understanding of two of the advanced features of Swift, which are generics and operators. Using these features, you can learn to build functionalities that are flexible and well defined, and also understand how nested types allow logical grouping, access, and namespacing for your constructs.

Chapter 5, Beyond the Standard Library, takes you on a journey to explore the functionalities beyond the standard library, provided by frameworks such as Foundation and UIKit. Learning to use these functionalities will help you make full use of the Swift language.

Chapter 6, Swift Playgrounds, gives a total understanding of using Swift Playgrounds and explores advanced features, apart from those explored in the initial chapters, to create fully interactive experiences.

Chapter 7, Server-Side Swift, covers a totally different aspect of Swift programming, server-side programming with Swift. Also, you can gain an understanding of how to run Swift on Linux by installing the Swift toolchain, learn to use a web server framework to build a REST API, and host your API via a hosting service. Also, you can learn to accomplish your tasks easily by understanding how to use Vapor, one of the most popular frameworks in Swift 4.

Chapter 8, Performance and Responsiveness in Swift, concludes the book by exploring the more advanced concepts of Swift programming to gain an understanding of how certain Swift types are implemented and their performance characteristics. Also, it explains how to perform asynchronous tasks using Grand Central Dispatch. Then, it explores the multithreaded environment available on all Apple platforms and how to enhance the performance profile of your Swift constructs to build a fast and responsive app.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime