SCKEventManaging

public protocol SCKEventManaging: class

A type that implements the required methods to provide events either synchronously or asynchronously to a SCKViewController; plus some methods related to the user interaction with the controller’s schedule view.

If you use Swift, you may choose between implementing SCKEventManaging or working in concrete mode by conforming to SCKConcreteEventManaging and declaring an event type. Use the concrete mode when working with a single event class to benefit from Swift’s type safety and work with better-typed methods in your event manager implementation. In any other case, conform to this protocol directly. See the SCKViewController class description to learn more.

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

    Declaration

    Swift

    func events(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.

    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.

    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 deselected in a schedule view.

    Parameter

    Parameter controller: The SCKViewController owning the schedule view.

    Declaration

    Swift

    func scheduleControllerDidClearSelection(_ controller: SCKViewController) -> Void

    Parameters

    controller

    The SCKViewController owning the schedule view.

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

  • Parameters:
  • controller: The SCKViewController owning the schedule view.
  • Date

    The double clicked date.

Declaration

Swift

func scheduleController(_ controller: SCKViewController,

Parameters

controller

The SCKViewController owning the schedule view.

date

The double clicked date.