Alright, this Saturday we’re going to use Swift Playgrounds on iPad to start a ridiculous todo app: ToDon’t: where we add things to NOT DO to your todo list so that you can cross them off & feel more productive.
#iOSDev #SwiftUI #iPad
1/n
Starting with the little todo bit I made from Core Data in Swift Playgrounds here: cephalopod.studio/blog/build-an-…
2/n
One thing I want to do is use the new SectionedFetchResults from Core Data so that my crossed off items go to a different area. Also made my task.name a non-optional string.
And I added a bit of animation and voila!
3/n
Already you can see my code getting a bit out of sorts, so let’s reorganize.
Here’s a little tour of the refactor. Complete with a little theme struct that I’ll use for some nice colors. Thinking of going for dark purple for my text color.
4/n
Playing around with designs a bit. Going so far with a light orange background and purple text and a list without separators.
Let me know how I can make it look nicer!
5/n
Okay, now I want to have multi-select deletion in this thing, and we’ll put that in a toolbar. I changed the Task id to be NSManagedObject id for the Identifiable, and that made deleting and such much easier. Here is a tour, important parts highlighted, and the result!
6/n
Now onto rearranging items!
Here is a BAD solution. Every time an object’s order is changed, every single item’s order property is updated. So not performant. This is where the leet code things are useful. For an interview question: How would you make this performant?
7/n
Meanwhile, I’ll add slide to delete with the onDelete block added to this section.
8/n
Alright, this is so easy it almost makes me angry. This is how I was able to add searching for an item via a multi sectioned Core Data app in #SwiftUI
It does mean you need to use NavigationView and List together, but if you’re in that design pattern, it’s way simple.
9/n
Now adding new items! I need to set the text to purple. Also made hacky little binding to pass in the last index of the number of items.
Now we have a basic todo app w/:
* Rearrange
* Slide to delete
* Search
* Multselect to delete
* Add new items
Feedback welcome!
10/n
And of course now that we’ve got all this shiny goodness, we want to make sure to save our work to a remote somewhere, so we’re going with @WorkingCopyApp to put our playground in a repo right from our iPad.
11/n
After careful consideration, I’ve settled on this as my app icon for ToDon’t. Reusing an image that my sister-in-law illustrator once made for me.
12/n
Last update for the evening. It occurred to me that I don’t have a good way to edit existing items already made. So now you tap on the specific diamond to check it off, and tapping the text lets you edit it.
In the video I highlight code updates
#iosdev #indiedev
13/n
Okay, I rearranged my setup so that I don’t have a submit button, but rather I depend on the submit of the textfield for an actual todo, and the button adds the don’ts. & we get don’t whenever we come back from the background too!
#iOSDev #indiedev
You might think, oh, well, we’re done. All that’s left is writing the actual fun “Don’t”s to add to ToDon’t
But now, we CELEBRATE every time your list is done w/ the help of this package: github.com/simibac/Confet…
I created 4 different celebration screens chosen at random.
15/n
And of course we want people to be able to disable the auto-adding of things not to do. And a little email link for support 16/n
And of course, if we had something with a lot of custom motion like confetti, we want another option for users if they have reduced motion turned on
17/n
Aww yeah, now we’re talking. Getting to the refinement stage.
And here is a sneak peak of some of the ToDon’ts too!
#iOSDev #IndieDevs #indiedeveloper #SwiftUI #swiftplaygrounds
18/n
Here is my Christmas gift to y’all, a TestFlight link to ToDon’t! Enjoy!
testflight.apple.com/join/9HbhWloc
#iosDev #indiedev #indiehacker
19/n
Oof, struggled to get screenshots together for AppStoreConnect, only being able to use the devices I have via TestFlight.
Finally got the app submitted to the App Store though!
And this little landing page on my website: cephalopod.studio/work/todont
#iOSDev #indiedev
20/n
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.