WhatsNewPageView
public struct WhatsNewPageView
extension WhatsNewPageView: View
extension WhatsNewPageView: _ViewEmptyChecking
WhatsNewPageView is used to inform users of new features during the onboarding process. It takes a collection of up to 10 views which it displays as a sequence of pages. Users can navigate through these pages by swiping horizontally or by tapping one of the navigation buttons in the component. Any type of view can be provided as a page, but we recommend using WhatsNewPage or a VStack containing multiple WhatsNewListItem views.
Usage
struct WhatsNewExample: View {
@State var presentPageViewExample = false
var body: some View {
Button("Present View") {
presentPageViewExample.toggle()
}
.sheet(isPresented: $presentPageViewExample, content: {
WhatsNewPageViewExample()
})
}
}
struct WhatsNewPageViewExample: View {
@Environment(\.dismiss) var dismiss
@State var selectedIndex: Int? = 0
var body: some View {
WhatsNewPageView(whatsNewPages: {
WhatsNewPage(detailImage: {
FioriIcon.illustrations.tentDot.resizable()
}, title: {
Text("Page 1")
}, description: {
Text("Description text")
}, imageSize: CGSize(width: 80, height: 80))
WhatsNewPage(detailImage: FioriIcon.illustrations.successScreenDialog.resizable(), title: "Page 2", description: "Description text", isImageExpanded: true)
VStack(alignment: .leading, spacing: 30) {
WhatsNewListItem(detailImage: Image("wheel").resizable(), title: "List item 1", subtitle: "Subtitle text")
WhatsNewListItem(detailImage: Image("ProfilePic").resizable(), title: "List item 2")
WhatsNewListItem(title: "List item 3", subtitle: "Subtitle text")
}
}, currentIndex: $selectedIndex, didClose: {
self.dismiss()
}, didFinish: {
self.dismiss()
})
}
}
-
Undocumented
Declaration
Swift
public init(@WhatsNewPagesBuilder whatsNewPages: () -> any View, currentIndex: Binding<Int?>, didClose: (() -> Void)? = nil, didFinish: (() -> Void)? = nil, componentIdentifier: String? = WhatsNewPageView.identifier) -
Undocumented
Declaration
Swift
static let identifier: String -
Undocumented
Declaration
Swift
init(_ configuration: WhatsNewPageViewConfiguration) -
Declaration
Swift
@MainActor public var body: some View { get } -
Undocumented
Declaration
Swift
public var isEmpty: Bool { get }