In my test demo, I put a UITableView into UIViewController in storyboard. When I test demo on my iPhone, I pressed one cell in tableView, I got this error in picture
In func previewingContext(previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController?
method, I use
guard let indexPath = tableView.indexPathForRowAtPoint(location), cell = tableView.cellForRowAtIndexPath(indexPath) else { return nil }
to get the pressed cell in UITableView.
I really appreciate if you give me any answers!