Skip to content

Instantly share code, notes, and snippets.

@FedeRotoli
Created January 24, 2020 15:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FedeRotoli/d0c6aea8051de94548be910ff260966f to your computer and use it in GitHub Desktop.
Save FedeRotoli/d0c6aea8051de94548be910ff260966f to your computer and use it in GitHub Desktop.
struct ContentView: View {
@State private var currentPage = 0
var body: some View {
//Pager Manager
VStack{
PagerManager(pageCount: 2, currentIndex: $currentPage) {
Text("First page")
Text("Second page")
}
Spacer()
//Page Control
HStack{
Circle()
.frame(width: 8, height: 8)
.foregroundColor(currentPage==1 ? Color.gray:Color.white)
Circle()
.frame(width: 8, height: 8)
.foregroundColor(currentPage==1 ? Color.white:Color.gray)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment