OCDoctorCardView: UI component
The OCDoctorCardView
is a customizable card view for displaying Doctor details.
It can include a name, speciality, address, distance, and opening times.
The appearance of the card can be customized using different background color.
Features
- User can pass the desired details to show like name, speciality, address, distance, and opening times.
- In bookMarkAction, user can defined their state action for bookMark
Installation
-
Copy the
DoctorCardView
component folder into your Xcode project. -
Use the
OCDoctorCardView
view in your SwiftUI code:
Parameters:
doctorInformation
: Name, speciality, speciality, address, distance and openingTime of the DoctordoctorCardViewStyle
: Set color for Doctor cardbookmarkAction
: Book action closure for save and remove as favorite
import SwiftUI
struct ContentView: View {
var body: some View {
VStack{
OCDoctorCardView(doctorInformation: DoctorInformation(name: "Dr. Sir M Visveshwarayya",
address: "Bangalore",
distance: "10 km",
openingTime: "Opening times only between 11: 00 AM to 3: 00 PM")) { state in
print(state)
}
.padding()
}
}