This repo contains the code for Secret Lab's book, Learning Swift, 3rd Edition.
In Learning Swift, 3rd Edition, you create Selfiegram, an app that makes use of several features of iOS, including working with the file system, capturing photos, and performing image analysis with the Vision framework. This repo contains the source code used in the book, as well as the playground that contains the general explanation of Swift that appears in Part 1 of the book.
You can buy Learning Swift at these fine purveyors of books:
- O'Reilly Media (direct from the publisher!)
- Amazon
If you're reading Learning Swift, 3rd Edition, you can use this repo to check your own code against what we made. If you just want to play with some code, you can fire up Selfiegram.xcodeproj
and take a look!
Please note: this repo contains the final version of the app. We deliberately designed the app so that you spend more time adding code than you do replacing code, which means that if you browse the code in this repo, you'll probably see more code than you've written so far.
Throughout the code in this repo, you'll see little tags like this:
// BEGIN tuples
let aTuple = (1, "Yes")
// END tuples
These BEGIN
and END
markers are used during the production of the book to include snippets of code into the final book. This ensures that the code that appears in the book is identical to what's in the repo (at least, what was in the repo when the book went to print.)
You can safely ignore the snippet tags - they don't do anything to the code. However, if you're interested in our snippet system, it's available on GitHub.
We hope that you find this repo useful. If you have issues, please either open an issue, or send us an email.
Unfortunately, we aren't taking contributions for this repo, because it was designed as a partner for a printed book, so accepting changes would likely throw it out of sync with the dead-tree version, leading to confused readers. However, you're strongly encouraged to fork the code, and make your own, even better version!
The code in this repository is licensed under the MIT license unless otherwise noted within specific files.
Copyright (c) 2018 Secret Lab, Pty. Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.