OCBannerView: UI component
The OCBannerView
is a customizable card view for displaying Banner details.
It can include a icon, title, primaryButton, secondaryButton and bannerType.
The appearance of the card can be customized using different background color.
Features
- User can pass the desired details to show like icon, title, primaryButton, secondaryButton and bannerType.
- The appearance of the card can be customized using different background color.
Installation
-
Copy the
BannerView
component folder into your Xcode project. -
Use the
OCBanner
view in your SwiftUI code:
Parameters:
icon
: Showing icon in Bannertitle
: Dispaying title in BannerprimaryButton
: Dispaying primaryButton in BannersecondaryButton
: Dispaying secondaryButton in BannerbannerType
: Set color for banner and its content
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
OCBanner(icon: .bannerImage,
title: "One line message with action",
primaryButton: OCButton(title: "Action 1", type: .textButton(hasUnderline: false)),
secondaryButton: OCButton(title: "Action 2", type: .textButton(hasUnderline: false)))
}.padding()
}
}