Member-only story
Creating Paging ScrollView using _VariadicView
Scroll paging effect in swiftUI using _VariadicView
Couple of days ago, I read a very interesting article written by Jacob Bartlett. This article talked about using _VariadicView swiftUI’s private api to create custom containers that feel natively built. Not just that it also allows you to do stuff (like adding custom set of modifiers) between the root and the leaf nodes of a container view.
Link to the article:
After reading this article I kept thinking, how can I use _VariadicView 🤔? And just before sleep the idea clicked and told my self, Let’s create a custom paging scroll view using _VariadicView. For me this seemed like the perfect useCase for it.
Thanks for reading Think Different! Subscribe for free to receive new posts and support my work. Also if you are not subscribe to Meduim
Before we dive in to the problem, for the people who don’t know what is the _VariadicView, let me explain to you.
As Jacob Bartlett said in his post:
is a private-ish SwiftUI API, and the underlying implementation detail for many of the container views you use every day.
It sounds pretty obscure, however its naming is actually pretty…