NACC_EventEditView
@MainActor
struct NACC_EventEditView : UIViewControllerRepresentable
Ugh. I hate using UIViewControllerRepresentable, but we need it for this.
This is how the Event editor is implemented.
-
We need to be able to allow the user to create reminder events, based on the cleandate. This handles the wrapped display of the Calendar Entry Edit sheet.
See moreDeclaration
Swift
final class Coordinator : NSObject, EKEventEditViewDelegate
-
This allows us to treat Event records as identifiable.
See moreDeclaration
Swift
struct EditableEvent : Identifiable -
The event store that handles the event.
Declaration
Swift
@MainActor let eventStore: EKEventStore -
The even we want to make a calendar entry for.
Declaration
Swift
@MainActor let event: EKEvent -
The callback, for when we’re done.
Declaration
Swift
@MainActor var onComplete: ((EKEventEditViewAction) -> Void)? -
This simply instantiates a new coordinator instance
Declaration
Swift
@MainActor func makeCoordinator() -> CoordinatorReturn Value
A new Coorcinator instance.
-
This creates our controller.
Declaration
Swift
@MainActor func makeUIViewController(context: Context) -> EKEventEditViewControllerParameters
contextThe context for the controller.
Return Value
An event view controller, ready to be shown.
-
This is a NOP function, here to satisfy the type.
Declaration
Swift
@MainActor func updateUIViewController(_: EKEventEditViewController, context: Context)Parameters
_The event (ignored)
contextThe context (also ignored)
View on GitHub