Swift was first introduced way back in 2014, at Apple’s annual Worldwide Developer Conference (WWDC). When showing off the new language, Chris Lattner (the creator of Swift) took to the stage and immediately did something that was revolutionary for us – at least back then: he created a Swift playground in Xcode.
You see, before then we were using Objective-C, which was a language that had no concept of interactive code playback, which meant we didn’t have the ability to tinker quickly with our code to try out experiments.
In fact, for some years all Swift playgrounds came with a quote at the top that set the tone perfectly: “Playground – noun: a place where people can play.” That didn’t mean the code we write in playgrounds isn’t important or serious, just that it’s built in an environment where tinkering is actively encouraged – we can make one small change and see it take effect immediately.
While learning Core Graphics and Core Animation, we built a sandbox where there’s no clutter and no complexity – it’s just a simple UI that lets us try things out freely, and without worry of breaking any important code. So, I hope today’s challenges will encourage you to try something new with what you’ve learned. Try various approaches to the same problem, try using code completion to explore, and just feel free to make mistakes – because each mistake will teach you something new, and help take you closer to your goal.
Today you should work through the wrap up chapter for project 27, complete its review, then work through all three of its challenges.
That’s another fun game complete, and one with lots of expansion possibilities – make sure you share your progress online!
Need help? Tweet me @twostraws!
TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and more!
The 100 Days of Swift is a free collection of videos, tutorials, tests, and more to help you learn Swift faster. Click here to learn more, or watch the video below.
Link copied to your pasteboard.