import SwiftUI
struct OnboardingView: View {
var fruits: [Fruit] = fruitsData
var body: some View {
TabView {
ForEach(fruits[0...5]) { item in
FruitCardView(fruit: item)
} // Loop
} // Tab
.tabViewStyle(PageTabViewStyle())
.padding(.vertical, 20)
}
}
struct OnboardingView_Previews: PreviewProvider {
static var previews: some View {
OnboardingView(fruits: fruitsData)
}
}
**You can try this here is a tabview which have 5 card that can be swipe there is a FruitCardView(fruit: item) is just a card view which had image and text.
------------------ or -------------------
If you are working in swift then you can use collection view there scroll is enable in horizontal axis**
**You can try this here is a tabview which have 5 card that can be swipe there is a FruitCardView(fruit: item) is just a card view which had image and text.
------------------ or -------------------
If you are working in swift then you can use collection view there scroll is enable in horizontal axis**