SCKConcreteEventManaging

public protocol SCKConcreteEventManaging: SCKEventManaging

A convenience generic wrapper (and thus, Swift only) around SCKEventManaging that provides better-typed methods for your event manager implementation.

Conform to this protocol when working with a single event class in a Swift target. In any other case, conform to SCKEventManaging directly. See the SCKViewController class description to learn more.

  • The event type that the associated SCKViewController manages.

    Declaration

    Swift

    associatedtype EventType
  • concreteEvents(in:for:) Default implementation

    This method is required when providing events to a SCKViewController synchronously.

  • Parameters:

    • dateInterval: The date interval being displayed.
    • controller: The SCKViewController requesting events.
  • Returns

    An array of events compatible with the passed date interval to be displayed in the controller’s schedule view.

    Default Implementation

    Declaration

    Swift

    func concreteEvents(in dateInterval: DateInterval,

    Parameters

    dateInterval

    The date interval being displayed.

    controller

    The SCKViewController requesting events.

    Return Value

    An array of events compatible with the passed date interval to be displayed in the controller’s schedule view.

  • This method is required when providing events to a SCKViewController asynchronously. To fetch events in a background queue, keep a reference of the event request (from which you can get the requested date interval) and perform the actual fetch asynchronously. When finished, make sure you call complete(with:) from the main queue to pass the fetched events back to the controller.

    • Parameters:
      • controller: The SCKViewController requesting events.
      • request: The just created event request.

    Default Implementation

    Declaration

    Swift

    func scheduleController(_ controller: SCKViewController,

    Parameters

    controller

    The SCKViewController requesting events.

    request

    The just created event request.

  • Implement this method to be notified when an event is selected.

    • Parameters:
      • controller: The SCKViewController owning the selected event view.
      • event: The selected event object.

    Default Implementation

    Declaration

    Swift

    func scheduleController(_ controller: SCKViewController,

    Parameters

    controller

    The SCKViewController owning the selected event view.

    event

    The selected event object.

  • Implement this method to be notified when an event is double clicked in a schedule view.

    • Parameters:
      • controller: The SCKViewController managing the event.
      • event: The double clicked event.

    Default Implementation

    Declaration

    Swift

    func scheduleController(_ controller: SCKViewController,

    Parameters

    controller

    The SCKViewController managing the event.

    event

    The double clicked event.

  • Implement this method to conditionally allow or deny a user-initiated duration change in one of the events managed by a SCKViewController. If you don’t implement this method, changes are allowed by default.

  • Parameters:

    • controller: The SCKViewController asking for permission.
    • event: The event’s whose duration is going to change.
    • oldValue: The current event’s duration in minutes.
    • newValue: The proposed event’s duration in minutes.
  • Returns

    true if the change should be commited or false instead.

    Default Implementation

    Declaration

    Swift

    func scheduleController(_ controller: SCKViewController,

    Parameters

    controller

    The SCKViewController asking for permission.

    event

    The event’s whose duration is going to change.

    oldValue

    The current event’s duration in minutes.

    newValue

    The proposed event’s duration in minutes.

    Return Value

    true if the change should be commited or false instead.

  • Implement this method to conditionally allow or deny a user-initiated date change in one of the events managed by a SCKViewController. If you don’t implement this method, changes are allowed by default.

  • Parameters:

    • controller: The SCKViewController asking for permission.
    • event: The event’s whose duration is going to change.
    • oldValue: The current event’s scheduled date in minutes.
    • newValue: The proposed event’s schaduled date in minutes.
  • Returns

    true if the change should be commited or false instead.

    Default Implementation

    Declaration

    Swift

    func scheduleController(_ controller: SCKViewController,

    Parameters

    controller

    The SCKViewController asking for permission.

    event

    The event’s whose duration is going to change.

    oldValue

    The current event’s scheduled date in minutes.

    newValue

    The proposed event’s schaduled date in minutes.

    Return Value

    true if the change should be commited or false instead.

  • Implement this method to conditionally provide a contextual menu for one or more events in a schedule view.

  • Parameters:

    • controller: The SCKViewController managing a right clicked event.
    • event: The right clicked event.
  • Returns

    An NSMenu object to will be displayed as a contextual menu or nil if you don’t want to display a menu for this particular event.

    Default Implementation

    Declaration

    Swift

    func scheduleController(_ controller: SCKViewController,

    Parameters

    controller

    The SCKViewController managing a right clicked event.

    event

    The right clicked event.

    Return Value

    An NSMenu object to will be displayed as a contextual menu or nil if you don’t want to display a menu for this particular event.

  • events(in:for:) Extension method

    Declaration

    Swift

    public func events(in dateInterval: DateInterval,
                           for controller: SCKViewController) -> [SCKEvent]

    Parameters

    dateInterval

    The date interval being displayed.

    controller

    The SCKViewController requesting events.

    Return Value

    An array of events compatible with the passed date interval to be displayed in the controller’s schedule view.

  • Declaration

    Swift

    public func scheduleController(_ controller: SCKViewController,
                                       didMakeEventRequest request: SCKEventRequest)

    Parameters

    controller

    The SCKViewController requesting events.

    request

    The just created event request.

  • Declaration

    Swift

    public func scheduleController(_ controller: SCKViewController,
                                       didSelectEvent event: SCKEvent)

    Parameters

    controller

    The SCKViewController owning the selected event view.

    event

    The selected event object.

  • Declaration

    Swift

    public func scheduleController(_ controller: SCKViewController,
                                       didDoubleClickEvent event: SCKEvent)

    Parameters

    controller

    The SCKViewController managing the event.

    event

    The double clicked event.

  • Declaration

    Swift

    public func scheduleController(_ controller: SCKViewController,
                                       shouldChangeDurationOfEvent event: SCKEvent,
                                       from oldValue: Int, to newValue: Int) -> Bool

    Parameters

    controller

    The SCKViewController asking for permission.

    event

    The event’s whose duration is going to change.

    oldValue

    The current event’s duration in minutes.

    newValue

    The proposed event’s duration in minutes.

    Return Value

    true if the change should be commited or false instead.

  • Declaration

    Swift

    public func scheduleController(_ controller: SCKViewController,
                                       shouldChangeDateOfEvent event: SCKEvent,
                                       from oldValue: Date, to newValue: Date) -> Bool

    Parameters

    controller

    The SCKViewController asking for permission.

    event

    The event’s whose duration is going to change.

    oldValue

    The current event’s scheduled date in minutes.

    newValue

    The proposed event’s schaduled date in minutes.

    Return Value

    true if the change should be commited or false instead.

  • Declaration

    Swift

    public func scheduleController(_ controller: SCKViewController,
                                       menuForEvent event: SCKEvent) -> NSMenu?

    Parameters

    controller

    The SCKViewController managing a right clicked event.

    event

    The right clicked event.

    Return Value

    An NSMenu object to will be displayed as a contextual menu or nil if you don’t want to display a menu for this particular event.