Hey! I don’t know much about ViewPager, but I assume it’s similar to this in UIKit:
Unfortunately to my knowledge there isn’t a way to achieve this in SwiftUI directly. Apple’s own SwiftUI tutorial uses UIViewRepresentable to use this UIKit element, so I’ve adapted their code to make this example:
Hope it helps!