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.

This simply controls display of the event add sheet.

  • 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 more

    Declaration

    Swift

    final class Coordinator : NSObject, EKEventEditViewDelegate

Identifiable Composition Struct

  • This allows us to treat Event records as identifiable.

    See more

    Declaration

    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() -> Coordinator

    Return Value

    A new Coorcinator instance.

  • This creates our controller.

    Declaration

    Swift

    @MainActor
    func makeUIViewController(context: Context) -> EKEventEditViewController

    Parameters

    context

    The 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)

    context

    The context (also ignored)