CalendarPermissionsValidator
open class CalendarPermissionsValidator
Validates the permissions for the app to access the calendar.
Subspec: Utility/CalendarPermissionsValidator
private lazy var calendarPermissionsValidator: CalendarPermissionsValidator = {
let validator = CalendarPermissionsValidator()
validator.delegate = self
return validator
}()
calendarPermissionsValidator.addEventToCalendar(eventInfo: eventCalendarInfo)
The CalendarPermissionsValidator uses the default EKEventStore to add an event to a user’s calendar if the necessary permissions are given.
-
Permissions delegate.
Declaration
Swift
public weak var delegate: CalendarPermissionsValidatorDelegate?
-
Default event store from the EventKit.
Declaration
Swift
private static var eventStore: EKEventStore
-
Attempts to add a event to the calendar.
Declaration
Swift
public func addEventToCalendar(eventInfo: EventCalendarInfo)Parameters
eventInfoEvent info to add.
-
Default initializer
Declaration
Swift
public init()
-
Checks the current calendar’s permissions.
Declaration
Swift
func checkCalendarPermissions(status: EKAuthorizationStatus, eventInfo: EventCalendarInfo)Parameters
statusStatus of the calendar permissions.
eventInfoUser’s event info to add to calendar.
-
Requests the current user’s permissions with the given parameter.
Declaration
Swift
func requestCalendarPemissions(eventInfo: EventCalendarInfo)Parameters
eventInfoEvent info to add to the calendar.
-
Adds the event infor to the calendar if it is not already found.
Declaration
Swift
func addToCalendar(eventInfo: EventCalendarInfo)Parameters
eventInfoEvent info to add to the calendar.
-
Determines if the event info provided is already found in the calendar.
Declaration
Swift
func eventFoundInCalendar(eventInfo: EventCalendarInfo) -> BoolParameters
eventInfoEvent info to add to the calendar.
Return Value
Flag that determines if the event was found.
-
Generates an EKEvent from the EventCalendarInfo.
Declaration
Swift
func newEvent(eventInfo: EventCalendarInfo) -> EKEventParameters
eventInfoEvent info used to convert to an EKEvent.
Return Value
EKEvent from the EventCalendarInfo.
CalendarPermissionsValidator Class Reference