Search code examples
swiftuiscrollview

SwiftUI fullscreen horizontal swipe with dot indicator


Many apps have an intro view that has fullscreen pages with a dot indicator at the bottom. Sometimes it is used to gather same basic information, sometimes to introduce the app features.

How can I realize that? I tried the ScrollView with a horizontal setting. The issue is to set up the content to fit the screen and have the edges snap on scroll. Second issue is the have a dotted indicator that highlights the current page.


Solution

  • you need to wrap UIPageControl with UIViewControllerRepresentable.