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
SCKViewControllermanages.Declaration
Swift
associatedtype EventType -
concreteEvents(in:for:)Default implementationThis 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
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:
-
scheduleController(_:didMakeConcreteEventRequest:)Default implementationThis 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
controllerThe SCKViewController requesting events.
requestThe just created event request.
- Parameters:
-
scheduleController(_:didSelectConcreteEvent:)Default implementationImplement 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
controllerThe SCKViewController owning the selected event view.
eventThe selected event object.
- Parameters:
-
scheduleController(_:didDoubleClickConcreteEvent:)Default implementationImplement 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
controllerThe SCKViewController managing the event.
eventThe double clicked event.
- Parameters:
-
scheduleController(_:shouldChangeDurationOfConcreteEvent:from:to:)Default implementationImplement 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.Default Implementation
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:
-
scheduleController(_:shouldChangeDateOfConcreteEvent:from:to:)Default implementationImplement 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.Default Implementation
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:
-
scheduleController(_:menuForConcreteEvent:)Default implementationImplement 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.Default Implementation
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:
-
events(in:for:)Extension methodDeclaration
Swift
public func events(in dateInterval: DateInterval, for controller: SCKViewController) -> [SCKEvent]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.
-
scheduleController(_:didMakeEventRequest:)Extension methodDeclaration
Swift
public func scheduleController(_ controller: SCKViewController, didMakeEventRequest request: SCKEventRequest)Parameters
controllerThe SCKViewController requesting events.
requestThe just created event request.
-
scheduleController(_:didSelectEvent:)Extension methodDeclaration
Swift
public func scheduleController(_ controller: SCKViewController, didSelectEvent event: SCKEvent)Parameters
controllerThe SCKViewController owning the selected event view.
eventThe selected event object.
-
scheduleController(_:didDoubleClickEvent:)Extension methodDeclaration
Swift
public func scheduleController(_ controller: SCKViewController, didDoubleClickEvent event: SCKEvent)Parameters
controllerThe SCKViewController managing the event.
eventThe double clicked event.
-
scheduleController(_:shouldChangeDurationOfEvent:from:to:)Extension methodDeclaration
Swift
public func scheduleController(_ controller: SCKViewController, shouldChangeDurationOfEvent event: SCKEvent, from oldValue: Int, to newValue: Int) -> BoolParameters
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. -
scheduleController(_:shouldChangeDateOfEvent:from:to:)Extension methodDeclaration
Swift
public func scheduleController(_ controller: SCKViewController, shouldChangeDateOfEvent event: SCKEvent, from oldValue: Date, to newValue: Date) -> BoolParameters
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. -
scheduleController(_:menuForEvent:)Extension methodDeclaration
Swift
public func scheduleController(_ controller: SCKViewController, menuForEvent event: SCKEvent) -> NSMenu?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.
-
scheduleControllerDidClearSelection(_:)Extension methodDeclaration
Swift
public func scheduleControllerDidClearSelection(_ controller: SCKViewController)Parameters
controllerThe SCKViewController owning the schedule view.
-
scheduleController(_:didDoubleClickBlankDate:)Extension methodDeclaration
Swift
public func scheduleController(_ controller: SCKViewController, didDoubleClickBlankDate date: Date)Parameters
controllerThe SCKViewController owning the schedule view.
dateThe double clicked date.
View on GitHub
Install in Dash
SCKConcreteEventManaging Protocol Reference