This is a follow up to a previous question that went unanswered: Swift EKCalendar not persisting
Previous Post Summary: In a nutshell, I can create new EKCalendars
, save them to the EventStore
, and event write events to them. However once the app goes into the background the EKCalendars
are deleted or removed from memory. Since figuring out how to make the calendar persist in the EventStore
is starting to seem like its not an option, I'm exploring some alternatives.
Thoughts: One idea was to store the EKCalendars
in the UserDefaults
as well as save them to the EventStore
. After looking into it a little i found very helpful posts such as this one: Save custom objects into NSUserDefaults in which they convert a custom object to NSData
and then store it. Unfortunately for me, EKCalendar
does not conform to the NSCoding
protocol, and as far as i know, there is no way to extend the class to do so?
Question: Is there a way to convert an EKCalendar
object, which does not conform to the NSCoding
protocol, into NSData
? Or is there a way to save the class objects location some other way?
Side Note: To avoid overlap on the questions, if you have any info about making the EKCalendar
persist in the EventStore
please post those responses in previous post link at the top.