Hung Truong: The Blog!

  • September 29, 2019

    Cloning Zwift on iOS Part 4: Workout View

    I haven’t been working as much on my workout app since it’s been good enough for me to use as a replacement for Zwift with the most recent changes I wrote about.

    I got a new iPhone so I had to build and install the app on my phone again, and after firing up Xcode I decided to go ahead and add a few more things that I was meaning to add to the app. The app hasn’t had a good visualization of workouts so I ended up creating an interface for that.

    More …

  • July 14, 2019

    Introducing BarkMode: Bark Detection + Dark Mode

    I was in California about a month ago for work and I was able to attend a few events during WWDC week. I read a lot about the new features and APIs but didn’t really have a lot of time to mess with stuff like SwiftUI, etc. I got a stupid idea for a project but I didn’t really take the time to work on it until this weekend. Now I’d like to introduce you to my latest app: Bark Mode!

    More …

  • May 03, 2019

    Cloning Zwift on iOS Part 3: HealthKit and a WatchOS App!

    I’ve been a bit slow to update my blog series about trying to make a clone of Zwift, but not because I’ve stopped working on it. Rather, I’ve been able to use the “MVP” of what I’ve built so far in parts 1 and 2, and I was finding that the time I spent working on my app could be used actually working out. Like, I literally would write an implementation of something, but it would take so much of my time that I couldn’t test it out and I’d have to go to bed… Still, I was missing a few important features in my app, so I’ve been slowly working on them in between working on my fitness.

    More …

  • April 07, 2019

    Making an iOS Zwift Clone to Save $15 a Month! Part 2: Reverse Engineering a Workout

    A very colorful Zwift Workout

    Last time, on “Making an iOS Zwift Clone to Save $15 a Month” I wrote about learning Core Bluetooth to connect to my exercise bike and get data streaming directly to my app.

    Since writing that article, I cleaned up the implementation of the Core Bluetooth service a bit and started supporting some additional data like distance, calories burned and cycling cadence.

    While cycling on my exercise bike and staring at these numbers is fun, the built-in screen on my bike already shows these numbers, so I essentially recreated a subset of the official ergData app so far.

    The ergData app is functional but ugly af

    I realized the next challenge would be to start a guided workout in my app and show the target wattage alongside my actual wattage on the bike.

    More …

  • March 17, 2019

    Making an iOS Zwift Clone to Save $15 a Month! Part 1: Core Bluetooth

    It’s been a while since I’ve worked on a personal project, but I’ve been having an itch to make some new iOS apps and yesterday morning I decided to go ahead and hack something together.

    I recently purchased an exercise bike called the BikeErg (I think the name has something to do with the rowing machines that the manufacturer also makes). The bike has a built-in computer that keeps track of things like watts (apparently cycling is a sport that has really good analytics since it’s easy to track raw power), calories burned, cadence and other stuff. You can view the data on the monitor or use an app like Zwift to do workouts.

    The BikeErg comes with the PM5: the most advanced PM thing ever.
    More …