Goal

This app desperately needs push notifications, so I'm going to try to sprint through a really basic rewrite or modernization of the Maitsu iPhone app.

December 21, 2023

I've been poking at this for a few days, and I've decided to start by trying to modernize the networking stack. This will make everything more complicated in the short term, but hopefully easier to manage in the long term.

I settled on Siesta (https://bustoutsolutions.github.io/siesta/) to replace Alamofire and in theory, I like it a lot. I was having trouble for a day or so because I was receiving responses from the API, but not data... Weird!

Once I poked at the actual response headers last night, I realized the API has been returning application/javascript for some arcane reason. Switching it to application/json fixed the mixup and now I can keep moving and work on decoding API responses into native Swift models.

December 22, 2023

We are decoding properly now! I used Swift Playgrounds to make a quick test environment which was really helpful. The most annoying thing was the path to learning about JSONDecoder's dateDecodingStrategy exists, which let me automatically decode date strings into native Date objects.

The nice thing about this is that when I ping a route, for example /users/jedmund it will automatically give me an object without me having to think about mapping it from JSON.

December 23, 2023

I didn't work on the iOS app today. Instead, I spent a bunch of time rewriting the networking calls in the web app to match some API changes I made to make iOS easier. Since I touched practically every page in the app, I also did refactoring here and there to make things nicer. It was very grueling and invisible work, but now it's done!

December 25, 2023

CleanShot 2023-12-24 at 22.36.34@2x Large.jpeg

I didn't get to networking yet because I got stuck re-learning how to draw in UIKit. Things are ugly and will stay that way for a bit, but we do have visual output!

I was a little too focused on keeping files as clean and organized as in the last iOS app and that was frustrating me yesterday. Today, I focused on getting any visual output to start, and we managed to make progress.

December 27, 2023

CleanShot 2023-12-27 at 01.31.38@2x.png

There is a very basic app UI that when you hit the button sends a login request to the server and receives data.

I'm still wrapping my head around the Siesta framework. Specifically, I'm still unsure how to wrap my head around maintaining resource state and where to store it. I am also still figuring out what the best way to structure code is. But we do have something that runs and connects to the server, even if it isn't stored.