Member-only story
SwiftUI’s Internal APIs: The Hidden Trap
Why you shouldn’t trust SwiftUI’s underscored or undocumented internals, no matter how tempting or useful they look.
Spend enough time reading about SwiftUI and you’ll eventually trip over something like _VariadicView
.
It’s not in the documentation. It’s not shown at WWDC. But it’s there, quietly inviting you to tap into the hidden power that Apple itself uses to build its most flexible views and layouts.
The promise is seductive: dynamic child views, runtime flexibility, workarounds for SwiftUI’s usual strictness.
And it will compile. It might even work.
But make no mistake… it won’t last.
SwiftUI’s underscored types are not undocumented gems waiting to be discovered. They’re implementation details, temporary scaffolding meant to be replaced or reworked whenever it suits Apple’s needs.
And if you build on them, you’re building on quicksand.
Why? Let’s take a look.
Using _VariadicView
I mentioned _VariadicView
, so let’s continue with that as our example. A _VariadicView
is an internal type SwiftUI uses to compose a dynamic set of child views at runtime.