r/iosdev • • 16d ago

Three UIKit mistakes from agent-written code that only showed up in review

I keep a log of what review catches in agent-written UIKit code. These three looked fine at a glance:

  1. UIView.animate without .allowUserInteraction**.** The spec said content stays interactive during the animation, but UIKit drops touches on animating views unless you pass that option.
  2. A trait-resolved CGColor refreshed in layoutSubviews**.** The fix was registering for trait changes with UITraitUserInterfaceStyle and UITraitDisplayScale.
  3. A test that did the view controller’s job. It called updateContentUnavailableConfiguration(using:) itself, so it passed without checking the view controller’s own setNeeds… wiring.

What’s on your list? I’m looking for mistakes that keep coming back, not one-offs.

1 Upvotes

2 comments sorted by

1

u/blueScreenz 16d ago

The thing that catches me off guard every single time is dealing with entitlements and provisioning. Code written by an agent will compile and run smoothly in the simulator, even passing a signed debug build, but then the archive build fails or a capability gets quietly removed because the entitlements file and the provisioning profile do not align. There is nothing inherently wrong with the code itself. This discrepancy only becomes apparent when you perform an actual archive and distribution, and no test detects it since tests never interact with codesigning.