Have you ever heard the phrase, “imitation is the highest form of flattery”? I can’t think of anywhere it’s more true than on iOS: Apple sets an extremely high standard for apps, and encourages us all to follow suit by releasing a vast collection of powerful, flexible APIs to work with.
Your challenge for this milestone is to use those API to imitate Apple as closely as you can: I’d like you to recreate the iOS Notes app. I suggest you follow the iPhone version, because it’s fairly simple: a navigation controller, a table view controller, and a detail view controller with a full-screen text view.
How much of the app you imitate is down to you, but I suggest you work through this list:
Codable
. You can use UserDefaults
if you want, or write to a file. (Project 12)UIActivityViewController
. (Project 3)Once you’ve done those, try using Interface Builder to customize the UI – how close can you make it look like Notes?
Note: the official Apple Notes app supports rich text input and media; don’t worry about that, focus on plain text.
Go ahead and try now. Remember: don’t fret if it sounds hard – it’s supposed to stretch you.
Here are some hints in case you hit a problem:
Note
class if you wanted, but to begin with perhaps just make each note a string that gets stored in a notes
array.Codable
– you might need to re-read project 12.NotificationCenter
to update the insets for your detail text view when the keyboard is shown or hidden.tintColor
property in Interface Builder. This controls the color of icons in the navigation bar and toolbar, amongst other things.BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.
Sponsor Hacking with Swift and reach the world's largest Swift community!
Link copied to your pasteboard.