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
dateIntervalThe date interval being displayed.
controllerThe SCKViewController requesting events.
Return Value
An array of events compatible with the passed date interval to be displayed in the controller’s schedule view.
- Parameters:
-
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
controllerThe SCKViewController requesting events.
requestThe just created event request.
- Parameters:
-
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
controllerThe SCKViewController owning the selected event view.
eventThe selected event object.
- Parameters:
-
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) -> VoidParameters
controllerThe 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
controllerThe SCKViewController owning the schedule view.
dateThe double clicked date.
-
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.
Declaration
Swift
func scheduleController(_ controller: SCKViewController,Parameters
controllerThe SCKViewController managing the event.
eventThe double clicked event.
- Parameters:
-
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
trueif the change should be commited orfalseinstead.Declaration
Swift
func scheduleController(_ controller: SCKViewController,Parameters
controllerThe SCKViewController asking for permission.
eventThe event’s whose duration is going to change.
oldValueThe current event’s duration in minutes.
newValueThe proposed event’s duration in minutes.
Return Value
trueif the change should be commited orfalseinstead. - Parameters:
-
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
trueif the change should be commited orfalseinstead.Declaration
Swift
func scheduleController(_ controller: SCKViewController,Parameters
controllerThe SCKViewController asking for permission.
eventThe event’s whose duration is going to change.
oldValueThe current event’s scheduled date in minutes.
newValueThe proposed event’s schaduled date in minutes.
Return Value
trueif the change should be commited orfalseinstead. - Parameters:
-
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 ornilif you don’t want to display a menu for this particular event.Declaration
Swift
func scheduleController(_ controller: SCKViewController,Parameters
controllerThe SCKViewController managing a right clicked event.
eventThe right clicked event.
Return Value
An NSMenu object to will be displayed as a contextual menu or
nilif you don’t want to display a menu for this particular event. - Parameters:
View on GitHub
Install in Dash
SCKEventManaging Protocol Reference