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
-
Copy the
InforCardViewcomponent folder into your Xcode project. -
Use the
OCInformationCardViewview in your SwiftUI code:
Parameters:
title: Title of the informationdescription: Description of the informationcaption: Caption of the informationicon: Icon of the informationbuttonText: Text for the button in infocardbuttonIcon: Icon for the button in infoormationcardbuttonIconAlignment: Icon alignment for the button in infoormationcardinformationCardViewStyle:.smallSmall icon to show in infocard,largeLarge icon to show in infocardinformationCardColor: 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)
}
}