Skip to main content
Version: Next

OCInformationCardView

The OCInformationCardView is a customizable card view for displaying information. It can include a title, description, caption, button, and icons. The appearance of the card can be customized using different background colors and icon sizes.

Features

  • User can pass the desired information to show like title, description, caption.
  • In buttonAction method, user can defined their button action for button
  • In largeIcon and smallIcon you can pass Image, systemImage, Icon etc.

Installation

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

  2. Use the OCInformationCardView view in your SwiftUI code:

Parameters:

  • title : Title of the information
  • description : Description of the information
  • caption : Caption of the information
  • icon : Icon of the information
  • buttonText : Text for the button in infocard
  • buttonIcon: Icon for the button in infoormationcard
  • buttonIconAlignment: Icon alignment for the button in infoormationcard
  • informationCardViewStyle : .small Small icon to show in infocard, large Large icon to show in infocard
  • informationCardColor: Set background color for information card
  • 'bulletList': Bullet item list with icon and title
import SwiftUI

struct ContentView: View {

var body: some View {
VStack {
// For small icon
OCInformationCardView(description: "Description", icon: Image("InfoIcon"),
buttonText: "Button",
informationCardViewStyle: OCInformationCardViewStyle(iconType: .small))

// Large icon
OCInformationCardView(description: "Description", icon: Image("LargeIcon")
buttonText: "Button",
informationCardViewStyle: OCInformationCardViewStyle(iconType: .large),
informationCardColor: .red)
}
.padding(32)
}
}