It seems that Apple's TabView took some steroids! ๐
Add the following to Package.swift:
.package(url: "https://github.com/stateman92/PagingTabView", exact: .init(0, 0, 5))@ObservedObject private var viewModel: PagingTabViewViewModel
// ...
VStack {
SegmentedControl(items: ["Gray", "Green", "Red", "Blue", "Brown"], selectedSegmentIndex: $viewModel.segmentIndex)
PagingTabView(offset: $viewModel.offset, index: $viewModel.index, viewSize: viewSize, horizontal: horizontal) {
ForEach(0...4, id: \.self) { index in
Image(systemName: "circle")
.resizable()
.aspectRatio(contentMode: .fit)
.foregroundColor(.red)
}
}
}For details see the Example app.
