dead_man
dead_man

Reputation: 409

How to set a custom identifier for events in ios swift?

I have following code in my program when I tried to run the program I'm getting "Cannot assign to 'eventIdentifier' in 'event'".

       var event = EKEvent(eventStore: inEventStore)
        event.calendar = inCalendar   
        event.title = title
        event.notes = notes
        event.startDate = startDate
        event.endDate = endDate
        event.eventIdentifier = identifier

Upvotes: 0

Views: 828

Answers (1)

Shrejas
Shrejas

Reputation: 478

That's because evenIdentifier is a readonly property, here is snippet from Apple's documentation:

@property(nonatomic, readonly, nonnull) NSString *eventIdentifier

I know its very late to answer this, hope answer will help other devs.

Upvotes: 1

Related Questions