LAST CHANCE: Register for my live Swift workshop days! >>

< Previous: Delivering notifications with CloudKit push messages: CKQuerySubscription   Next: Project 34 >

Wrap up

This was an epic tutorial: epic in length, epic in breadth, and I hope you'll agree epic in what we've accomplished. You've built another real app, you've learned about AVAudioRecorder, CKQuery, CKRecord, CKAsset, CKQueryOperation, CKQuerySubscription, NSPredicate, NSSortDescriptor and more, while also having some bonus practice working with UIStackView, UITableView and NSAttributedString.

So yes, the tutorial was long, but even though you're tired I'd like to think you're pleased with the end result. Take a break, perhaps even a couple of days, then come back and have a think about how you could improve this project. It's so big there are lots of possibilities, not least:

  • If the iCloud fetch fails, we tell the user. How about adding a "Retry" button to the user interface?
  • We made the Whistle class inherit from NSObject. Can you make it conform to the NSCoding protocol? You might find project 12’s guide to NSCoding and UserDefaults in Swift useful.
  • Fix the AddCommentsViewController class so that it correctly adjusts the text view when the keyboard appears. I already showed you how to do this in project 16.
  • Stop people from posting too many line breaks in their comments, or at least trim the comments when shown in the main table view.

Of course, the other thing you could do is perhaps the most important of all: go back through all your code and make sure you handle CloudKit errors gracefully. Seriously, put your hand in the air and repeat after me: I promise to show meaningful iCloud errors to my users.

Now, I know you didn't actually do that, but you really ought to at least mean it. As Apple has said, handling errors is the difference between working apps and non-working apps, and you don't want a non-working app, do you?

You did it! Now what?

You finished another project, and I'm glad Hacking with Swift helped you. Now I need your help. Please take just a moment out of your day to tell others about Hacking with Swift so they can benefit too.

You can click below to post a tweet straight to this project. Or if you're feeling particularly generous, you can click here to link to Hacking with Swift on your website and help spread the word.

Thank you. Your support is what keeps me going!

 

About the author

Paul Hudson is the creator of Hacking with Swift, the most comprehensive series of Swift books in the world. He's also the editor of Swift Developer News, the maintainer of the Swift Knowledge Base, and Mario Kart world champion. OK, so that last part isn't true. If you're curious you can learn more here.

Upgrade to the premium experience

Get all 40 projects in PDF and ePub, plus exclusive content that will take your Swift learning to the next level – buy the Hacking with Swift book today!

< Previous: Delivering notifications with CloudKit push messages: CKQuerySubscription   Next: Project 34 >
Click here to visit the Hacking with Swift store >>