It’s been a week of slamming my full time tutors OpenAI and Google while I worked with Swift and an iOS native app for the first time.
I just added Kingfisher as my first open source package so figured it’s time for an update.
Take aways from working on this project in the past week:
- Always ask for “idiomatic {language or framework} solutions”
But gain enough experience to know when to break from tradition.
- Current AI struggles with strategic decisions.
AI had as much trouble making strategic decisions on state management in Swift / iOS as it does on my TS/React/Redux/Zustand apps. You really need to take over here, because it has no way to reconcile when things should be stored and how it affects app UX.
- Compiling source text for big context window models is a game changer.
I’ve been combining sources to a single .txt
for Gemini and its’ 1 million token context window. This wouldn’t work for larger codebases, but my wife is incredibly picky detail oriented on app interactions 😅 so this app has gotten to 160k tokens in about a week due to account for retries, user feedback messages, love notes easter eggs, etc.
My xcode/swift script is here: https://gist.github.com/jonshaffer/6d32294233e46b1ea56ca36396339981
- It’s not every day you get to try a whole new mature programming language.
This was pretty fun. I enjoyed working with protocols, making orchestrators. I tolerated refactoring the fully-synchronous code from my initial AI generation to the “new” (no idea how new it actually is) async/await capabilities in Swift.
- AI is not enough to really gap refactors when you don’t have the specific experience.
Pretty much the same as (2). My original refactor - the goal of the first screenshot, took about 2 days to get to. This ended up being nowhere near where I wanted the code to be in a stable state. For one example - GenAI gave me the gift of refactoring several different spellings of forUser:, for:, userId, uid, user passed as parameters for nearly every function. It was always available from FirestoreAuth from the beginning, but I did make an AuthService to abstract some checking logic. I had to detect and push it towards most abstractions.
Would love to hear about your experiences in learning how to work with our new fancier rubber ducks!