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 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
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.
- 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
controller
The SCKViewController requesting events.
request
The 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
controller
The SCKViewController owning the selected event view.
event
The 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
controller
The SCKViewController managing the event.
event
The 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
true
if the change should be commited orfalse
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 orfalse
instead. - 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
true
if the change should be commited orfalse
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 orfalse
instead. - 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 ornil
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. - Parameters:
-
events(in:for:)
Extension methodDeclaration
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.
-
scheduleController(_:didMakeEventRequest:)
Extension methodDeclaration
Swift
public func scheduleController(_ controller: SCKViewController, didMakeEventRequest request: SCKEventRequest)
Parameters
controller
The SCKViewController requesting events.
request
The just created event request.
-
scheduleController(_:didSelectEvent:)
Extension methodDeclaration
Swift
public func scheduleController(_ controller: SCKViewController, didSelectEvent event: SCKEvent)
Parameters
controller
The SCKViewController owning the selected event view.
event
The selected event object.
-
scheduleController(_:didDoubleClickEvent:)
Extension methodDeclaration
Swift
public func scheduleController(_ controller: SCKViewController, didDoubleClickEvent event: SCKEvent)
Parameters
controller
The SCKViewController managing the event.
event
The double clicked event.
-
scheduleController(_:shouldChangeDurationOfEvent:from:to:)
Extension methodDeclaration
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 orfalse
instead. -
scheduleController(_:shouldChangeDateOfEvent:from:to:)
Extension methodDeclaration
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 orfalse
instead. -
scheduleController(_:menuForEvent:)
Extension methodDeclaration
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.
-
scheduleControllerDidClearSelection(_:)
Extension methodDeclaration
Swift
public func scheduleControllerDidClearSelection(_ controller: SCKViewController)
Parameters
controller
The SCKViewController owning the schedule view.
-
scheduleController(_:didDoubleClickBlankDate:)
Extension methodDeclaration
Swift
public func scheduleController(_ controller: SCKViewController, didDoubleClickBlankDate date: Date)
Parameters
controller
The SCKViewController owning the schedule view.
date
The double clicked date.