As a result, tools like Claude, Codex, and Gemini often make unhelpful choices you should watch out for. Sometimes you’ll come across deprecated API, sometimes it’s inefficient code, and sometimes it’s just something we can write more concisely, but they are all easy enough to fix so the key is just to know what to expect!
Before I start, I want to mention three things up front:
1. This advice assumes you’re able to target modern versions of iOS, i.e. iOS 18 or later. If you need to support older versions, your AI of choice will have a better chance of getting it correct.
2. This is not designed to be an exhaustive list; it’s just the most common things I look out for.
3. I’m not interested in arguing about whether LLMs are good or not; I accept they exist, and that many people want to use them, so I might as well help folks use them better.
Still here? Okay…
- Every time you see
foregroundColor(), switch it out forforegroundStyle(). It’s the same number of characters to type, but the former is deprecated, whereas the latter supports more advanced features like gradients. - Replace
cornerRadius()withclipShape(.rect(cornerRadius:)). Again, the former is deprecated, whereas the latter offers more advanced features such as uneven rounded rectangles. - The
onChange()modifier should not be used in its 1-parameter variant. Either accept two parameters or none, but the old variant is unsafe and deprecated. - If you see the old
tabItem()modifier, replace it with the newTabAPI instead. This lets you benefit from the new type-safe tab selection, and also adopt things like the iOS 26 search tab design. - Replace almost all use of `onTa...
