OCPageView
Introduction
OCPageView
is a view component that can be used to swipe through a list of pages with page indicators at the bottom.
OCPageView
OCPageView
is a view that accepts a list of pages and selected index to allow scrolling through the list of pages. OCPageView
has 3 parameters in its init,
- selectedIndex, binding int for controlling selected page
- pages, pages for the page view
- style, styling for page view
Integration
import SwiftUI
struct ContentView: View {
var page1: some View {
VStack {
OCOnboardingCardView(imageType: .local(image: Image("OnboardCardViewPlaceholder"),
title: "Title here",
description: "Get started with our amazing app.")
}
}
var page2: some View {
VStack {
OCOnboardingCardView(imageType: .local(image: Image("OnboardCardViewPlaceholder"),
title: "Title here",
description: "Get started with our amazing app.")
}
}
var page3: some View {
VStack {
OCOnboardingCardView(imageType: .local(image: Image("OnboardCardViewPlaceholder"),
title: "Title here",
description: "Get started with our amazing app.")
}
}
@State static var selectedIndex: Int = 0
static let pages = [page1, page2, page3]
var body: some View {
OCPageView(selectedIndex: $selectedIndex,
pages: pages
)
.frame(height: 500.0)
}
}