diff --git a/ios/Classes/SwiftDeviceCalendarPlugin.swift b/ios/Classes/SwiftDeviceCalendarPlugin.swift index 0ea540d3..5dd2ba71 100644 --- a/ios/Classes/SwiftDeviceCalendarPlugin.swift +++ b/ios/Classes/SwiftDeviceCalendarPlugin.swift @@ -90,7 +90,7 @@ public class SwiftDeviceCalendarPlugin: NSObject, FlutterPlugin, EKEventViewDele let calendarNotFoundErrorMessageFormat = "The calendar with the ID %@ could not be found" let calendarReadOnlyErrorMessageFormat = "Calendar with ID %@ is read-only" let eventNotFoundErrorMessageFormat = "The event with the ID %@ could not be found" - let eventStore = EKEventStore() + lazy var eventStore = EKEventStore() let requestPermissionsMethod = "requestPermissions" let hasPermissionsMethod = "hasPermissions" let retrieveCalendarsMethod = "retrieveCalendars"