Created
October 25, 2023 21:49
-
-
Save 10Macit/317d4ffc96a0a41aeb4c8fddee8afdb4 to your computer and use it in GitHub Desktop.
CalendarView
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MyContentView: View { | |
@StateObject var viewModel = EventStore() | |
var body: some View { | |
MyCalendarViewRepresentable(calendarView: viewModel.calendarView) | |
} | |
} | |
struct MyCalendarViewRepresentable: UIViewRepresentable { | |
typealias UIViewType = UICalendarView | |
var calendarView: UICalendarView | |
func makeUIView(context: Context) -> UICalendarView { | |
calendarView | |
} | |
func updateUIView(_ uiView: UICalendarView, context: Context) { | |
} | |
} | |
class EventStore: NSObject, ObservableObject { | |
@Published var calendarView = UICalendarView() | |
override init() { | |
super.init() | |
calendarView.delegate = self | |
} | |
} | |
extension EventStore: UICalendarViewDelegate { | |
//delegates | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment