EventKitInterfaceProtocol
public protocol EventKitInterfaceProtocol
Define metohods required to interact with EventKit
framework.
Seealso
EventKitInterface
Seealso
EventKitHandler
-
This closure passes information about a complete asynchronous task.
Depending on the outcome the error may be available, and the success flag changes its value.
Declaration
Swift
typealias CompletionBlock = (Bool, Error?) -> Void
-
Adds all calendar items to the
EKEventStore
.Declaration
Swift
func addAll(_ calendarItems: [EKCalendarItem], forType type: EKEntityType, completion: @escaping CompletionBlock)
Parameters
calendarItems
List of calendar items, a subclasses of
EKCalendarItem
.type
Type of entity to add.
completion
Completion closure called after items were saved to the store.
-
Remove all calendar items from the
EKEventStore
.Declaration
Swift
func removeAll(ofType type: EKEntityType, completion: @escaping CompletionBlock)
-
Request access to the
EventKit
framework for given item type.Declaration
Swift
func requestAccess(forType type: EKEntityType, completion: @escaping (Bool, Error?, EKEventStore?) -> Void)
Parameters
type
Type of entity to request access.
completion
Completion closure.
-
Checks if the application is authorized to use events or reminders.
Declaration
Swift
static func authorized(forType type: EKEntityType) -> Bool
Parameters
type
The type of entity (events or reminders) to check.
Return Value
true
if the application was authorized,false
otherwise.