Swift 4 Programming Cookbook

Over 50 recipes to help you quickly and efficiently build applications with Swift 4 and Xcode 9
Preview in Mapt

Swift 4 Programming Cookbook

Keith Moon

3 customer reviews
Over 50 recipes to help you quickly and efficiently build applications with Swift 4 and Xcode 9
Mapt Subscription
FREE
$29.99/m after trial
eBook
$18.00
RRP $35.99
Save 49%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$18.00
$44.99
$29.99 p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Swift 4 Programming Cookbook Book Cover
Swift 4 Programming Cookbook
$ 35.99
$ 18.00
Mastering Swift 4 - Fourth Edition Book Cover
Mastering Swift 4 - Fourth Edition
$ 35.99
$ 18.00
Buy 2 for $35.00
Save $36.98
Add to Cart

Book Details

ISBN 139781786460899
Paperback384 pages

Book Description

Swift 4 is an exciting, multi-platform, general-purpose programming language. Being open source, modern and easy to use has made Swift one of the fastest growing programming languages. If you interested in exploring it, then this book is what you need.

The book begins with an introduction to the basic building blocks of Swift 4, its syntax and the functionalities of Swift constructs. Then, introduces you to Apple's Xcode 9 IDE and Swift Playgrounds, which provide an ideal platform to write, execute, and debug the codes thus initiating your development process. Next, you'll learn to bundle variables into tuples, set order to your data with an array, store key-value pairs with dictionaries and you'll learn how to use the property observers. Later, explore the decision-making and control structures in Swift and learn how to handle errors in Swift 4.

Then you'll, examine the advanced features of Swift, generics and operators, and then explore the functionalities outside of the standard library, provided by frameworks such as Foundation and UIKit. Also, you'll explore advanced features of Swift Playgrounds. At the end of the book, you'll learn server-side programming aspect of Swift 4 and see how to run Swift on Linux and then investigate Vapor, one of the most popular server-side frameworks for Swift.

Table of Contents

Chapter 1: Swift Building Blocks
Introduction
Your first Swift program
Strings, Ints, Floats, and Bools
Optionals, unwrap, and force unwrap
Functions
Object classes
Structs
Enumerations
Closures
Protocols
Chapter 2: Building on the Building Blocks
Introduction
Bundling variables into tuples
Ordering your data with arrays
Containing your data with sets
Storing key-value pairs with Dictionaries
Subscripts for custom types
Changing your name with typealias
Getting property changing notifications using property observers
Controlling access with access control
Extending functionality with extensions
Chapter 3: Data Wrangling with Swift Control Flow
Introduction
Making decisions with if/else
Switch it up
For the love of loops
While loops
Try, throw, do and, catch - Swift error handling
Checking up front with guard
Doing it later with defer
Bailing out with fatalError and precondition
Chapter 4: Generics, Operators, and Nested Types
Introduction
Using generics with types
Using generics with functions
Using generics with protocols
Advanced operators
Option set
Create custom operators
Nested types
Chapter 5: Beyond the Standard Library
Introduction
Foundation
Networking
JSON
XML
Cocoa Touch
Chapter 6: Swift Playgrounds
Introduction
Using Swift Playgrounds for UI
Import Resources into Playgrounds
Import Code into Playgrounds
Multi-Page Playgrounds
Chapter 7: Server-Side Swift
Introduction
Swift on Ubuntu
Building a REST API using Vapor
Persistence with Vapor using Postgres
Hosting your Vapor app on Heroku
Chapter 8: Performance and Responsiveness in Swift
Introduction
Value and reference semantics
Dispatch Queues
Concurrent queues and dispatch groups
Operations

What You Will Learn

  • Explore basic to advanced concepts in Swift 4 Programming
  • Unleash advanced features of Apple's Xcode 9 IDE and Swift Playgrounds
  • Learn about the conditional statements, loops, and how to handle errors in Swift
  • Define flexible classes and structs using Generics, and learn about the advanced operators, and create custom operators
  • Explore functionalities outside of the standard libraries of Swift
  • Import your own custom functionality into Swift Playgrounds
  • Run Swift on Linux and investigate server-side programming with the server side framework Vapor

Authors

Table of Contents

Chapter 1: Swift Building Blocks
Introduction
Your first Swift program
Strings, Ints, Floats, and Bools
Optionals, unwrap, and force unwrap
Functions
Object classes
Structs
Enumerations
Closures
Protocols
Chapter 2: Building on the Building Blocks
Introduction
Bundling variables into tuples
Ordering your data with arrays
Containing your data with sets
Storing key-value pairs with Dictionaries
Subscripts for custom types
Changing your name with typealias
Getting property changing notifications using property observers
Controlling access with access control
Extending functionality with extensions
Chapter 3: Data Wrangling with Swift Control Flow
Introduction
Making decisions with if/else
Switch it up
For the love of loops
While loops
Try, throw, do and, catch - Swift error handling
Checking up front with guard
Doing it later with defer
Bailing out with fatalError and precondition
Chapter 4: Generics, Operators, and Nested Types
Introduction
Using generics with types
Using generics with functions
Using generics with protocols
Advanced operators
Option set
Create custom operators
Nested types
Chapter 5: Beyond the Standard Library
Introduction
Foundation
Networking
JSON
XML
Cocoa Touch
Chapter 6: Swift Playgrounds
Introduction
Using Swift Playgrounds for UI
Import Resources into Playgrounds
Import Code into Playgrounds
Multi-Page Playgrounds
Chapter 7: Server-Side Swift
Introduction
Swift on Ubuntu
Building a REST API using Vapor
Persistence with Vapor using Postgres
Hosting your Vapor app on Heroku
Chapter 8: Performance and Responsiveness in Swift
Introduction
Value and reference semantics
Dispatch Queues
Concurrent queues and dispatch groups
Operations

Book Details

ISBN 139781786460899
Paperback384 pages
Read More
From 3 reviews

Read More Reviews

Recommended for You

Mastering Swift 4 - Fourth Edition Book Cover
Mastering Swift 4 - Fourth Edition
$ 35.99
$ 18.00
Swift 4 Protocol-Oriented Programming - Third Edition Book Cover
Swift 4 Protocol-Oriented Programming - Third Edition
$ 31.99
$ 16.00
Test-Driven iOS Development with Swift 4 - Third Edition Book Cover
Test-Driven iOS Development with Swift 4 - Third Edition
$ 31.99
$ 16.00
Mastering iOS 11 Programming - Second Edition Book Cover
Mastering iOS 11 Programming - Second Edition
$ 35.99
$ 18.00
Test-Driven iOS Development with Swift 3 Book Cover
Test-Driven iOS Development with Swift 3
$ 31.99
$ 16.00
Swift 3 Object-Oriented Programming - Second Edition Book Cover
Swift 3 Object-Oriented Programming - Second Edition
$ 31.99
$ 16.00