EKEventViewController does not show event information

Currently, I work in iOS11b6, and the section of my code for opening an event EKEventViewControllerdoes not show information about the event - it just shows "New Event", "January 1, 2001", "Untitled" ,.

Section of my code to display the event below (works fine in iOS10)

func openEvent() {
    eventIdentifier = eventClipboardIdentifier

    let eventViewController = EKEventViewController.init()
    eventViewController.event = self.getEventFromEventClipboard()
    print(eventViewController.event.title)

    eventViewController.delegate = self
    eventViewController.allowsCalendarPreview = false
    eventViewController.allowsEditing = true

    let navBar = UINavigationController(rootViewController: eventViewController)
    print(eventViewController.event.title)

    present(navBar, animated: true, completion: nil)
}

The error I get in the Xcode debugger is below.

2017-08-20 20:25:48.001329+1000 CalendarApp[1113:281191] *** -[__NSCFCalendar components:fromDate:]: date cannot be nil
Future exception.
A few of these errors are going to be reported with this complaint, then further violations will simply be ignored.
Here is the backtrace where this occurred this time (some frames may be missing due to compiler optimizations):

The last print command is designed to verify that the event clicks on eventViewController, and everything looks fine.

When I 'edit' an event in EKEventViewController(with incorrect information) it EKEventViewControllerloads correctly.

I looked at the beta and can not find any information about EKEventViewController.

Any ideas?

+6
1

, iOS11.

allowsCalendarPreview true .

+1

All Articles