Count The Days Left Rewrite30 Sep 2022
I started my Count The Days Left iOS app back in 2015(!), mainly as an exercise to learn the (then) new Swift language, but also to have an app to count down to end of my current contract work!
I’ve made the occasional tweak over the years, but decided it was time it received a bit more love, so I’ve completely rewritten it - even though it basically works in the same way.
Switching to SwiftUI
I’d already switched the WatchOS app to SwiftUI a few years ago, but now all of the UI code is written in SwiftUI.
For such a simple app, SwiftUI is perfect. I’ve done quite a few SwiftUI projects recently and am happy that the ease of development and increased productivity outweigh the occasional glitches.
I’m not sure the Mac app settings screen is that great though. For SwiftUI to be truly great for cross-platform work, it’s on the Mac that is by far the most problematic. If I have the energy I may go back and try to improve that.
I think the app’s UIis so much better now. It was a lot easier to add a nice animation on the progress view - take a look at this preview video to see what I mean …
WatchOS now supports iCloud Key-Value store sync
The app uses both UserDefaults and iCloud key-value store to store the user’s settings. The latter is used so you can sync your settings across devices.
Previously, pushing the settings to the watch meant some complicated logic in manually pushing the settings across from the phone every time they changed, which was problematic and a bit unreliable.
Now in watchOS 9.0, the watch also supports iCloud Key-Value store sync, which made the code MUCH simpler as it can now reuse the data management code from the main app.
This has meant that the watch app now has a minimum OS version of 9.0+, but again I think the trade off of much increased reliability is worth it.
I’ve completely rewritten the widget code, and also added some nice lock screen widgets for iOS 16 users.
Moving to watchOS 9.0 also means I can reuse the widget code to improve the watch complications.
The Siri shortcuts code is much improved too - moving to the new AppIntents framework and SwiftUI for the visual component.
I’m also using the new shortcut provider API to suggest an appropriate shortcut to access your days left data directly in the Shortcuts app.
Modernised Swift code
It’s probably to be expected, but some of the 7 year old code was VERY out of date, and a little embarrasing 😳
I’ve restructured so it’s much better organised, uses protocols and generics where appropriate, and is a much better showcase for what I can do (I hope!)
Using SwiftUI means the accessibilty features are generally better straight out of the box, but I have spent some time making sure that voice over works well, as well as making the UI scalable using differemnt font sizes.
Removed some legacy extensions
The old school Today widget has gone, as has the iMessage extension - that seemed a good idea at the time but they really haven’t take off (to say the least!)
I’ve also removed the “tip” option, where people could do an in-app purchase to say thanks. TBH so few people were using it - and I definitely wasn’t promoting it in any way! - that I couldn’t be bothered to spend the effort porting the code.
I’m really happy with the updated code, and I’ll be much happier in potential customers looking at it as an example of my work.
If you want to take a look yourself, it’s here on GitHub