Skip to content

How can I access the index within the carousel? #70

Closed Answered by austinmrobinson
austinmrobinson asked this question in Q&A
Discussion options

You must be logged in to vote

I figured it out by creating an index variable
@State var carouselIndex: Int and setting it within onCarousel

.onCarousel { context in
      carouselIndex = context.index
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dscyrescotti
Comment options

Answer selected by austinmrobinson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants