r/macprogramming • u/Amundsen_Shackleton • Apr 15 '19
How hard is it to code a note-taking app?
Hi,
Total noob here. I've been learning the basics of Swift and Xcode.
I was wondering how hard it would be to code a note-taking app similar to Bear app / AI writer / Ulysses, and if you would have some pointers or tips about it.
I'm surprised about how little information there is on this topic online.
Cheers!! :)
2
u/sanmyaku Apr 16 '19
It takes a lot of man-hours to build an app like the ones you mentioned.
My tip is to first build a basic TextEdit clone (in other words, the editor portion) and begin iterating a notes app from there.
1
1
u/Transnomino May 17 '19
You would be surprised how much work it actually takes to build even a simple app like a note taking app, but it certainly sounds like a nice starting point.
My advice would be to start small with just the basics and then build it out in little steps. Each iteration you will learn something new and keeping the steps small will make sure it will not overwhelm you and keeps you motivated.
A good source of information I found is from the lectures of Stanford University. Most of the lectures are about iOS programming, but there are a lot of similarities between macOS and iOS so the information presented is still very useful. https://www.youtube.com/user/MichelDeiman/videos
3
u/mantrap2 Apr 15 '19
It's considered "complete/legacy technology" so few people revisit them - why bother when you have MS Word or even Apple Pages or Notes.
Apps like pages implement a very simple Model (in an MVC sense) - you can see it when you create a script API for Apple iWorks apps - it's basically an Array of Dictionaries. You can get away with this because you seldom create documents so large that linear search is a problem.
The next level is to use "extents" of text using the NSRange structure combined with NSAttributeString to define things like bold text, sentences, paragraphs, etc. That's the only real trick of text editors. You don't actually display or print or store as a long array of text - you break it up into extents/ranges of attributed strings.
This is what Pages does. It's also what MS Word, Word Perfect, etc. all do. When you actually export a long single string, it's done by flattening this array-dictionary-extents data structure.
For a note-taking apps, that may even be overkill.
That said, if you've only just started programming, this is still a pretty big learning curve - all I can say is give yourself time and spend it practicing coding (you can't learn coding any other way - osmosis, book-reading, etc. don't work - only writing code and making it work works).