Learning Swift, 1st Edition
This repo contains the code for Secret Lab's book, Learning Swift, 1st Edition.
In Learning Swift, you create a family of apps, which all work together to let the user create documents with attachments. This repo contains the source code used in the book for all three of the apps - the OS X app, the iOS app and the watchOS app - 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:
How to use this repo
If you're reading Learning Swift, you can use this repo to check your own code against what we made. If you just want to play with some code,
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
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.
Unforatunately, 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) 2016 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.