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!

An iOS developer who writes about gadgets, startups and cybersecurity. Swift programming tutorials and SwiftUI documentation too. robsturgeon.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store