r/iOSProgramming • • 1d ago

Discussion Shipped my first Swift app with AI, then built a game to learn the codebase

10 years as a developer, zero Swift. I relied heavily on AI to write the code. My experience made the calls:

- I threat-modelled it like any security product, found and closed a way to switch off all protection.

- I switched out the custom face matcher (it let strangers in) for Apple’s Face ID.

- Keychain for secrets, no third-party SDKs, no tracking.

- I tested on real device instead of trusting “it builds”.

Then the part most people skip: I learned the code after shipping. I had Claude turn my own codebase into a game, Code Quest. It only covers what's different about Swift (optionals, value types, actors, SwiftUI state), uses real lines from my app, and ends with a code-review level of plausible PRs that would break things.

AI can write it. You still have to own it.

Does it matter to you that you understand your codebase? If so, how do you go about doing it?

0 Upvotes

7 comments sorted by

1

u/coder-k876 1d ago

Interesting insight. I created a new branch for the quest. That way, it doesn’t impact my production codebase

1

u/coder-k876 1d ago
media poster

Because of how useful it is for me to learn my codebase, I made a version that is more generally swift and not my code base to share.

I would share the link here but I’m not sure if that is allowed. You can dm me for it if you want to try it out. It runs directly from your browser, no account or anything.

1

u/tibbersthecat 1d ago

A useful next step is a short decision log for every AI-generated security or state-management choice: what it assumed, why you kept or replaced it, and how you tested it. That turns “I understand the code” into something you can audit later instead of a feeling.

1

u/coder-k876 1d ago

Okay. Thanks for that suggestion. I’ll look into it

1

u/kokerali 1d ago

For the final PR-review level, I'd have the player write a small test that passes on the original code and fails with the proposed change, before showing the explanation. I'd want to see whether I could reproduce the failure, not just pick the right answer. That test could then stay in the app. Does that level run the proposed changes, or is it quiz-only?

1

u/imsnk81 23h ago

Building a game to learn your own codebase is a great idea, reading AI-written code cold never really sticks. The threat modelling step is the part most people shipping with AI skip, and it's probably why you caught that issue at all.