r/iOSProgramming • u/yccheok • Sep 27 '26
Discussion Does anyone let AI modify their UIKit Storyboards and XIBs?
Hi everyone,
For the past few months, I've been using AI (specifically Gemini) to write SwiftUI code, and it’s been working almost perfectly.
With UIKit projects, however, my usual workflow for Storyboards has been manual: I'd set up the UI, drag and drop the connections to my Swift files, and only ask the AI to handle the actual logic.
Today, I decided to test its limits and asked the AI to add a new UI component directly, without stopping it from modifying the Storyboard's source code. To my surprise, it updated the Storyboard without any errors!
Since Storyboard XML is notoriously messy and not very human-readable, I really didn't expect the AI to handle it so well.
I'm curious about your experiences. Do you let AI directly manipulate your Storyboard or XIB files? Does it work flawlessly for you, or do you find that it sometimes corrupts the file?
Thanks!
20
u/malleyrex Sep 27 '26
Yes. In the last 6 months, the confidence I have with AI writing code is up about 100x. If you think Gemini is good, Claude will blow you away.
7
u/kokerali Sep 27 '26
A successful XML edit is a good sign, but I wouldn’t treat a clean build as the whole test. I’d review the storyboard diff for changed outlets, actions, reuse identifiers and constraints, then launch the affected screen and exercise the new control in a UI test. A storyboard can still compile while a connection points to the wrong object or a layout fails at a different size. Keeping those edits in a small commit makes it much easier to spot what the AI actually changed.
1
u/HappyFunBall007 Sep 29 '26
I recently had claude migrate an app off of storyboards and onto SwiftUI - I had about 15-20 storyboards and old UIKit code I wanted to modernize. Claude wrote a plan that worked through the various tasks in logical steps that were reversible and would not break the app mid-migration.
It all worked very well. Just let the AI read and manage the XML. Messy stuff like XML is precisely the sort of thing an AI handles with ease.
2
u/B8edbreth Sep 27 '26
Yes, but rarely. usually after about 10 hours when I don't feel like screwing with it any more
2
u/wonderbatou Sep 27 '26
I used AI to migrate storyboards/xib files to SwiftUI! It was surprisingly good, and was able to integrate with the new design system.
So to answer your question, I just let AI delete and recreate them, all those files are treated as legacy code in my projects.
1
u/epictime8 Sep 27 '26
I let it edit Storyboard XML once on a mid-size UIKit screen and it did add the new control plus outlet without breaking IB open. What bit me was a quiet priority change on a sibling stack-view constraint — looked fine until layout failed on the SE width. Now I only let the model touch a brand-new scene, always git-diff the .storyboard before commit, and keep size-class / container work hand-edited in IB while AI stays on the Swift side.
1
u/Ok-Tomatillo-8712 Sep 27 '26
It handles managed object files well too
1
u/beclops Swift Sep 28 '26
Man I gotta say I have not had this experience with Gemini at all
1
u/Flashy_Imagination_6 Sep 28 '26
Been letting Claude edit my storyboards for about a month now.
My trick is splitting the UI into smaller XIBs. Smaller files mean the agent is less likely to break stuff when making changes
and it uses fewer tokens
1
u/[deleted] Sep 27 '26
[removed] — view removed comment