OCInformationPage: UI component
The OCInformationPage
is a full-screen view that contains a banner like image at top with and instance of OCTitle, a decription and an option view at the bottom. The view also has a bubble view with an option to add an icon image and update its and bubble's tint color.
Features
- User can pass the title, description, background image, bubble image and icon image
- In style, iconTintColor,bubbleTintColor, descriptionColor, titleTextStyle
Installation
-
Copy the
Information Page
folder into your Xcode project. -
Use the
OCInformationPage
view in your SwiftUI code:
Parameters:
configuration
: AOCInformationPageConfigurationProtocol
instance to set the data and images neededstyle
: AOCInformationPageStyleProtocol
instance to set custom stylingbottomView
: An optional bottom view
import SwiftUI
struct OCInformationPageTemplate: View {
var body: some View {
// swiftlint:disable line_length
let config = OCInformationPageConfiguration(iconImage: .local(image: .infoIcon), title: "Was bedeutet “aktiv” sein?", description: "Ob Du mit dem Fahrrad statt mit dem Auto zur Arbeit fährst, die Mittagspause für einen Spaziergang nutzt oder Workouts absolvierst – an wie vielen Tagen in der Woche integrierst Du Bewegung in Deinen Alltag?")
let style = OCInformationPageStyle(iconTintColor: .textBodyDefault, bubbleTintColor: .bubbleYellow)
OCInformationPage(configuration: config, style: style, bottomView: {
VStack {
OCButton(title: "Aktiv", type: .primary, maxWidth: .infinity) { _ in
}
.padding(.horizontal, OCConstants.UIComponent.padding24)
.padding(.top, OCConstants.UIComponent.padding24)
OCButton(title: "Nein", type: .secondary, maxWidth: .infinity) { _ in
}
.padding(.horizontal, OCConstants.UIComponent.padding24)
.padding(.top, OCConstants.UIComponent.padding8)
}
}
)
}
}