Swift Books
Swift is a powerful and intuitive general-purpose programming language for the OS X, iOS, watchOS, and Linux operating systems. It is developed by Apple Inc. Swift is intended to be more resilient to erroneous code (“safer”) than Objective-C, and more concise.
Swift is a new language, first appearing in 2014. It is friendly to new programmers, feels familiar to Objective-C developers, and the language is optimized for development. It was launched under a proprietary license, but Apple made the language open source in December 2015 by releasing Swift 2.2 and later under the Apache License 2.0. By open-sourcing Swift, developers are able to use the language for their own purposes and go beyond OS X, iOS and watchOS apps.
Besides the official Swift Programming Language book (featured below), there are no other good quality open source Swift books. Given the short passage of time since Apple open sourced the language, this isn’t that surprising. There was an interesting ‘The Swift Book’, which is available under the MIT license, but it is mostly incomplete and updates have stalled. Fortunately, there are some excellent Swift books which can be read without charge which fill the void.
We have published a series covering the best open source programming books for other popular languages. Read them here.
|
By Apple Inc. (525 pages)
The Swift Programming Language is the authoritative reference for Swift, offering a guided tour, a comprehensive guide, and a formal reference of the language.
The book is available as a ePub, but there are PDF versions available to download.
This book is made available under the Creative Commons Attribution 4.0 International (CC BY 4.0) License. Unfortunately, the rest of the books featured in this article are not released under an open source license. |
|
By Anthony Gray (186 pages)
This pocket reference sets out Swift’s modern language features, including type safety, generics, type inference, closures, tuples, automatic memory management, and support for Unicode.
Topics include:
- Swift’s Run-Eval-Print-Loop (REPL) and interactive playgrounds
- Supported data types, such as strings, arrays, and dictionaries
- Variables and constants
- Program flow: loops and conditional execution
- Classes, structures, enumerations, functions, and protocols
- Closures: similar to blocks in Objective-C and lambdas in C#
- Optionals: values that can explicitly have no value
- Operators, operator overloading, and custom operators
- Access control: restricting access to types, methods, and properties
- Built-in global functions and their parameter requirements
NOTE: This book is not released under an open source license. |
|
By Aidan Finn (HTML)
The aim of this book is to quickly and succinctly introduce and demonstrate all the major features of the Swift programming language.
Chapters cover:
- Running Code – create a simple hello world program and run it in Swift
- Basics – sets out some of the basics of Swift
- Constants and Variables
- Static Typing and Type Inference – with reference to the benefits of static typing
- Arrays
- Dictionaries – learn how to perform some common operations on dictionaries
- Tuples – a brief look at this ordered list of elements
- Control Flow – if, loops, switch, altering control
- Optionals – declaring, forced unwrapping, conditional unwrapping, using optionals, and dictionaries
- Functions and Closures – defining and more
- Classes – introduces classes, showing you how to define a class, methods, properties: stored and computed, lazy stored properties, property callbacks, subscripts, object initialization, deinitialization, inheritance, and more
- Structures – highlights the differences between structures and classes
- Enumerations – defining and using, raw values, associated values, associates values versus raw values, pattern matching with switch
- Protocols – defining and conforming to a protocol
- Extensions – defining extensions
- Memory Management – highlights where you may need to get involved in the memory management of objects manually
- Error handling – try, catch and throws, assertions, enums
- Generics – a way of defining functions or types that can work with multiple different data types
- What next? – some resources for building iOS or OS X apps in Swift
NOTE: This book is not released under an open source license. |
|
By Paris Buttfield-Addison, Jon Manning, Tim Nugent (39 pages)
This book offers a concise tour of Swift 3 and its growing ecosystem. The book highlights the new features of Swift 3, and using it on non-Apple platforms.
This book helps the reader to:
- Get a high-level view of Swift 3’s changes and new features, and learn how this version differs from Swift 2
- Explore the Swift Evolution Process and the full list of accepted proposals—including those not yet implemented
- Dive into Swift 3’s changes to the language’s syntax, standard library features, and other areas
- Examine Swift 3’s use on the server, and use a simple program to learn about Swift’s use on Linux
- Find further resources for learning about, working with, and converting projects to Swift 3
NOTE: This book is not released under an open source license. |
|
By Paul Hudson (HTML)
Hacking with Swift is designed for beginners to intermediate programmers wishing to learn Swift 3 and iOS development with real-world, practical projects. The e-book contains the following projects.
- Storm Viewer: Get started coding in Swift by making an image viewer app and learning key concepts
- Guess the Flag: Make a game using UIKit, and learn about integers, buttons, colors and actions
- Social Media: Let users share to Facebook and Twitter by modifying project 1
- Easy Browser: Embed Web Kit and learn about delegation, KVO, classes and UIToolbar
- Word Scramble: Create an anagram game while learning about closures and booleans
- Auto Layout: Get to grips with Auto Layout using practical examples and code
- Whitehouse Petitions: Make an app to parse Whitehouse petitions using JSON and a tab bar
- 7 Swifty Words: Build a word-guessing game and master strings once and for all
- Grand Central Dispatch: Learn how to run complex tasks in the background with GCD
- Names to Faces: Get started with UICollectionView and the photo library
- Pachinko: Dive into SpriteKit to try your hand at fast 2D games
- UserDefaults: Learn how to save user settings and data for later use
- Instafilter: Make a photo manipulation program using Core Image filters and a UISlider
- Whack-a-Penguin: Build a game using SKCropNode and a sprinkling of Grand Central Dispatch
- Animation: Bring your interfaces to life with animation, and meet switch/case at the same time
- JavaScript Injection: Extend Safari with a cool feature for JavaScript developers
- Swifty Ninja: Learn to draw shapes in SpriteKit while making a fun and tense slicing game
- Debugging: Everyone hits problems sooner or later, so learning to find and fix them is an important skill
- Capital Cities: Teach users about geography while you learn about MKMapView and annotations
- Fireworks Night: Learn about timers and color blends while making things go bang!
- Local Notifications: Send reminders, prompts and alerts even when your app isn’t running
- Detect-a-Beacon: Learn to find and range iBeacons using our first project for a physical device
- Space Race: Dodge space debris while you learn about per-pixel collision detection
- Swift Extensions: Try your hand at improving the built-in data types of Swift
- Selfie Share: Make a multipeer photo sharing app in just 150 lines of code
- Marble Maze: Respond to device tilting by steering a ball around a vortex maze
- Core Graphics: Draw 2D shapes using Apple’s high-speed drawing framework
- Secret Swift: Save user data securely using the device keychain and Touch ID
- Exploding Monkeys: Remake a classic DOS game and learn about destructible terrain and scene transitions
- Instruments: Become a bug detective and track down lost memory, slow drawing and more
- Multibrowser: Get started with UIStackView and see just how easy iPad multitasking is
- SwiftSearcher: Add your app’s content to Spotlight search and take advantage of the new Safari integration
- What’s that Whistle?: Build a crowd-sourced song recognition app using Apple’s free platform as a service. CloudKit
- Four in a Row: Let iOS take over the AI in your games using GameplayKit
- Generating random numbers: GameplayKit can help you generate random numbers in ways you soon won’t be able to live without
- Crashy Plane: Ever wanted to make a Flappy Bird clone? Now you can do it in under an hour thanks to SpriteKit
- Psychic Tester: Are you psychic? Of course not. But what if we could use our coding skills to make a game to fool your friends into thinking otherwise?
- GitHub Commits: Get on board with Core Data and learn to read, write and query objects using Apple’s object graph and persistence framework
- Unit testing with XCTest: Learn how to write unit tests and user interface tests using Xcode’s built-in testing framework
NOTE: This book is not released under an open source license. |
Click to rate this software
Like this:
Like Loading...
Related
About The Author
Steve Emms
Steve Emms is the main author of OSSBlog.org. This site aims to promote open source software and hardware. Steve has written thousands of articles about open source software. He is also the creator of LinuxLinks.com.