Discover more from Third Culture Letters
S03E42 – The Flash
Good morning 👋
This week was spent mostly working on charts. The current version of Appy Weather has quite a few, but v2 makes them an integral part of the experience. Prior to this week, Daniel Gindi’s popular iOS charts library was being used to create them. It provided a ton of functionality and customisation. That’s arguably because it’s built on a legacy UI framework (not SwiftUI). So there was something about its look and feel that didn’t feel modern, and therefore misaligned with the rest of the app’s UX. I had similar feelings when actually working on it. The codebase was massive and just identifying the relevant area of code was a challenge. Forget about the hacks involved to make the desired tweaks. So on Friday I decided to see whether I can build something myself. 30 minutes later I had. What! It was a range bar chart, similar to the one already being used on the Daily screen visualising the weather for the next seven days. I then challenged myself to go one better. Am I able to have another visual within it to indicate precipitation levels? Yes I was. To round it off, now that everything was in SwiftUI, could I get it to animate? Of course! A lot of the credit goes to SwiftUI (and its incredibly community). I have never felt so empowered when building interfaces. I would never have even considered attempting this in any other UI framework, forget about actually pulling it off. I need to take some credit too.
Earlier in the week instead of directly focusing on the chart’s visuals, I went on a side-quest to optimise the data it receives as inputs to make it seamless to display any data in chart form. See, most data points have different units and scales, e.g. the UV index ranges from 1 to 11, and that’s different to temperature. For charts to display either correctly, either I customise chart’s interpretation of the data on a per point basis (what I do currently in v1), or I somehow make the values it receives to follow a consistent scale. It took a bit of trial and error and some creativity but I cracked it. What this facilitates is super easy charts to build and maintain, and therefore expect to see a lot more of them in v2. It’s going to be a visual treat.
Have a great Sunday!