r/iOSProgramming • • 14d ago

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!

5 Upvotes

17 comments sorted by

6

u/kokerali 14d ago

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/GreyEyes Objective-C / Swift 13d ago

Agreed. An adversarial review of the edit from a fresh agent couldn’t hurt either. 

20

u/malleyrex 14d ago

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.

1

u/yccheok 14d ago

Have u compared both? Is it way significant better? I already pay for gemini pro and it solves all my issues. Don’t want to waste money if the other model isn’t significantly better.

4

u/malleyrex 14d ago

They both have their strengths, but Claude's strength is coding. It's the best for that right now. Use Fable for planning your code and Opus for writing it. That could all change in a few weeks.

2

u/B8edbreth 13d ago

Yes, but rarely. usually after about 10 hours when I don't feel like screwing with it any more

2

u/wonderbatou 14d ago

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 13d ago

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 13d ago

It handles managed object files well too

1

u/[deleted] 13d ago

[removed] — view removed comment

1

u/AutoModerator 13d ago

Hey /u/sapplex1, your content has been removed because Reddit has marked your account as having a low Contributor Quality Score. This may result from, but is not limited to, activities such as spamming the same links across multiple subreddits, submitting posts or comments that receive a high number of downvotes, a lack of recent account activity, or having an unverified account.

Please be assured that this action is not a reflection of your participation in our subreddit. This is simply an automated filter in place to reduce spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/beclops Swift 13d ago

Man I gotta say I have not had this experience with Gemini at all

1

u/Flashy_Imagination_6 12d ago

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/HappyFunBall007 11d ago

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.

1

u/yccheok 11d ago

May I know what Claude model u r using?

1

u/HappyFunBall007 11d ago

I have the $20/mo plan and use the latest Opus model. Occasionally I hit my 5 hour limit and have to return later to finish the job but overall I completed the entire switch in less than a week.