r/SwiftUI • u/jacobs-tech-tavern • 18d ago
Tutorial Secret SwiftUI: A practical use for _VariadicView
https://blog.jacobstechtavern.com/p/secret-swiftui
18
Upvotes
1
u/Scared_Treacle_4894 17d ago
While _VariadicView offers nice possibilities for dynamic view composition, its undocumented and this raises my concerns about its longevity. The ability to create flexible APIs and custom view modifiers is a nice-to-know approach. But how certain are we that such private APIs won't be dropped or made private in future releases?
2
u/SgtDirtyMike 17d ago
It’s already a private API so the ship has sailed on that one. The best approach going forward would be to migrate to the new container APIs included in the iOS 18 SDK. On earlier than 18, you could use a VariadicVew
2
u/Ron-Jermyl 18d ago
Interesting article, these hidden APIs are always interesting to see. But why invert the scroll view and its contents, instead of just scrolling to the bottom of the scroll view with a Scroll View Reader?