在我的测试演示中,我将 UITableView 放入情节提要中的 UIViewController 中。当我在我的 iPhone 上测试演示时,我在 tableView 中按下了一个单元格,我在图片中收到了这个错误
在func previewingContext(previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController?
方法中,我使用
guard let indexPath = tableView.indexPathForRowAtPoint(location), cell = tableView.cellForRowAtIndexPath(indexPath) else { return nil }
在 UITableView 中获取按下的单元格。
如果你能给我任何答案,我真的很感激!