cellForRowAtIndexPath is never called (numberOfRowsInSection is) using UITableViewController with the following way:
import UIKit
import EventKit
class Even
Replace your code in viewDidLoad with this.
self.eventStore.requestAccessToEntityType(.Event) {
(granted, error) -> Void in
guard granted else { fatalError("Permission denied") }
let endDate = NSDate(timeIntervalSinceNow: 604800)
let predicate = self.eventStore.predicateForEventsWithStartDate(NSDate(),
endDate: endDate,
calendars: nil)
self.eventsThisWeek = self.eventStore.eventsMatchingPredicate(predicate)
dispatch_async(dispatch_get_main_queue(),{
self.tableView.reloadData()
})
print(self.eventsThisWeek.count)
}
Your cellForRowAtIndexPath
doesn't call because when your view is loaded at that time array was empty and when the self.eventStore.requestAccessToEntityType is completely executed and load array with new value you weren't notifying your tableView to reload the data as you have new values in your array.