Skip to main content
Version: 12.10.0

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

  1. Copy the BannerView component folder into your Xcode project.

  2. Use the OCBanner view in your SwiftUI code:

Parameters:

  • icon : Showing icon in Banner
  • title : Dispaying title in Banner
  • primaryButton : Dispaying primaryButton in Banner
  • secondaryButton : Dispaying secondaryButton in Banner
  • bannerType : 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()
}
}