Today I start building a new app, using SwiftUI!

Learning SwiftUI — from a html form to a SwiftUI interface

Me and a buddy of mine @zh0r1k have been doing boxing workouts for a few months now.

Both being programmers, we are quite pragmatic at improving our workouts.

A few workouts in, we introduced a timer which helps us standartise the workout and ensure we don’t slack too much (or rest too little).

One of the things we always found tricky was figuring out what punch sequence we should be doing and given we do 4 sets of 5 rounds, we have to figure out 20 sequences each time.

Doesn’t sound like much, but you try coming up with 2-3-4-5 punch combinations every minute, when you’re out of breath and trying to focus on your technique.

So an idea for a round generator was born and each of us wrote it in our own ways.

I’m a web #frontend dev, so naturally I decided to write it in JavaScript. Svelte has been on my radar for a while so I decided to go with that.

The code turned into a mess of functions and render template pretty quickly. It works, but it’s messy, also the website in safari can’t keep the screen awake for long enough.

And in my ideal world, the punches show up right there, next to the timer.

So a need for an app was born.

Yesterday I wasted three hours trying to set up React native on my m1 macbook. That did not go well. Latest node doesn’t play ball with outdated expo, that doesn’t work with latest react-native and so on and so forth. I ended up in package hell for three hours updating and downgrading packages, not fun.

At some point I gave up and figured that there’s no possible way SwiftUI is this much of a mess. Sure it’s a new language for me (I don’t know Objective C or Swift at all). But surely I can figure it out, as long as the damn thing builds, right?

Well, it’s been a treat so far. I am a a total of three hours into learning and working with SwiftUI and so far I’m enjoying every moment.

Things make sense.

Everything is documented.

And the app builds!

Next up — rewriting the workout generation logic using swift. Wish me luck. I’ll do my best to document my path and hopefully make it interesting.

Learning SwiftUI — from a html form to a SwiftUI interface