EKEventEditViewController add and cancel buttons do not respond

I am trying to add a calendar event using EKEventEditViewController. I installed EKEventEditViewControllerc correctly EKEventStore, EKEventand its editViewDelegateas a view controller. EKEventEditViewControllerdisplays correctly, but when I click "add" or "cancel", didCompleteWithActionit is not called in EKEventEditViewDelegate. But, I get this error (no crash):

[EKCalendarItemLocationInlineEditItem isSubitemAtIndexSaveable:] - Location Inline Edit Item didn't have a text label on its non conference location cell; will return NO

You can see here what EKCalendarItemLocationInlineEditItemis in the structure EventKitUI.

This seems to have something to do with location, but I can't figure it out. Has anyone ever encountered this error or had any tips on how to debug further? Thank you I am running iOS 11 and Xcode 9.0.1.

+4
source share
1 answer

It looks like you did not set editViewDelegatebefore the submission EKEventEditViewController. Without a delegate, the add and cancel buttons do not respond.

EventView Creation and View (Swift)

let eventView: EKEventEditViewController = EKEventEditViewController()
eventView.event = event
eventView.editViewDelegate = self
eventView.eventStore = eventStore

present(eventView, animated: true) { }

Objc

EKEventEditViewController *eventView = [[EKEventEditViewController alloc] init];
eventView.event = event;
eventView.editViewDelegate = self;
eventView.eventStore = eventStore;

[self presentViewController:eventView animated:true completion: nil];
+1
source

Source: https://habr.com/ru/post/1688948/


All Articles