Correct Page Index for Carousel Modal
SwiftUI Mastery Travel Discovery
In today's lesson, we'll go over a quick bug fix that allows us to present the correct page in our carousel modal.

Comments (1)
iTollMouS
2 years ago
This is how I came up with it . Super short and elegant TabView(selection: $selectedPhotoIndex) { ForEach(photos, id: \.self){ photo in WebImage(url: URL(string: photo)) .resizable() .indicator(.activity) .transition(.fade) .scaledToFill() .frame(width: UIScreen.main.bounds.width, height: 400) .clipped() //to display the correct paging index .tag(photos.firstIndex(of: photo) ?? 0) } }.tabViewStyle(PageTabViewStyle(indexDisplayMode: .always))
Brian Voong
2 years ago
iTollMouS
2 years ago
My of learning , once I see a concept, like to toy around to experiment all the possibilities and the capabilities.
HELP & SUPPORT