Coding diary: Sketches and plans

After a bit of research, I’ve decided on going forward with a habit tracking app, specialized to analyse data in HealthKit, particularly nutrition. For instance, it’ll be handy for bodybuilders - you’ll be able to track how often you’ve “hit your macros” (protein, carbs and fat). It won’t be a place to search for or track individual foods - there’s a bunch of those already. It’s more about being able to see your consistency in reaching those nutrition and activity goals over time, using data that’s already sitting on your phone. Plus some other fancy shit, obviously.

More thinking, less coding this week - lots of time spent sketching out the flow of application data, especially in terms of modules. And I literally have been sketching - I’ve tried with the Apple Pencil but it just is not the same as:

Added bonus - this seems to be the only existing combination of paper and pend that renders my handwriting vaguely legible.

I have an idea of what I’ll need:

  • a testing framework that can both generate random data and test known consistency streaks. GKGaussianDistribution will be handy here, as well as the chapter in Advanced Swift dealing with Iterators, Sequences and Collections.
  • a HealthKit manager to retrieve and write data, receive background updates as well as to package it in a form that can be stored in CoreData
  • a CoreData stack, looking far simpler for my purposes in iOS 10 (see this nice NSScreencast summary or the WWDC videos from last year)
  • a nice wrapper around UserDefaults - I’ll probably go this one from Radek Pietruszewski here or grab from github
  • an open source collection view calendar component (like this, with support for selecting ranges, because I’m not doing that from scratch if I don’t have to

As well as areas for more research:

  • HealthKit & time zones looks a bit sketchy
  • custom UI for data visualizations - will take me aaaages to design

I’m progressing with my Algorithms course, and I’m now experimenting with Swift on the command line. (NSScreencast again has a really nice set up for this in the series on coding katas, starting here.) The lack of autocomplete is 😱, but I do like the lightweight feel without Xcode project overheads and so many redundant files. I give myself 48 hours before running back to the GUI begging for forgiveness.