These three projects were a mixed bag in terms of difficulty: although Safari extensions are clearly a bit of a wart in Apple’s APIs, it’s still marvelous to be able to add features directly to one of the most important features in iOS. As for the Fireworks Night project, I hope it showed you it doesn’t take much in the way of graphics to make something fun!
You also learned about local notifications, which might seem trivial at first but actually open up a huge range of possibilities for your apps because you can prompt users to take action even when your app isn’t running.
The best example of this is the Duolingo app – it sets “You should practice your language!” reminders for 1 day, 2 days, and 3 days after the app was most recently launched. If you launch the app before the reminders appear, they just clear them and reset the timer so you never notice them.
Here’s a quick reminder of the things we covered:
UITextView
. This is used by apps like Mail, Messages, and Notes, so you’ll definitely use it in your own apps.NSDictionary
type. It’s not used much in Swift because you lose Swift’s strong typing, but it’s occasionally unavoidable.NotificationCenter
center class to receive system messages. Specifically, we requested that a method be called when the keyboard was shown or hidden so that we can adjust the insets of our text view. We’ll be using this again in a later project, so you have ample chance for practice.follow()
SKAction, which causes a node to follow a bezier path that you specify. Use orientToPath: true
to make the sprite rotate as it follows.color
and colorBlendFactor
properties for SKSpriteNode
, which let you dynamically recolor your sprite.motionBegan()
method, which gets called on your view controllers when the user shakes their device.for case let
syntax for adding a condition to a loop.SPONSORED Still waiting on your CI build? Speed it up ~3x with Blaze - change one line, pay less, keep your existing GitHub workflows. First 25 HWS readers to use code HACKING at checkout get 50% off the first year. Try it now for free!
Sponsor Hacking with Swift and reach the world's largest Swift community!
Link copied to your pasteboard.