这是我展示自定义$crud->set_crud_url_path(site_url('admin/products/list'));
的方式:
UIPresentationController
点击func presentOverlayController(controller: UIViewController) {
controller.modalPresentationStyle = .Custom
controller.transitioningDelegate = self
presentViewController(controller, animated: true, completion: nil)
}
//MARK: - UIViewControllerTransitioningDelegate
public func presentationControllerForPresentedViewController(presented: UIViewController, presentingViewController presenting: UIViewController, sourceViewController source: UIViewController) -> UIPresentationController? {
return OverlayPresentationController(presentedViewController: presented, presentingViewController: presenting)
}
后,我会出示我的控制器。只有当我点击两次细胞时,它才会很快呈现。但是,当我执行单击时,它也能正常工作但延迟很大(15-60秒之间)。
是什么原因? 如何解决它?
答案 0 :(得分:2)
我发现了didSelectRowAtIndexPath
的已知错误,这也是我使用的解决方法。
尝试在didSelectRowAtIndexPath
:
dispatch_async(dispatch_get_main_queue(), {
presentOverlayController(......)
})
参考文献:
答案 1 :(得分:1)
试试这个:
dispatch_async(dispatch_get_main_queue()) {
self.presentViewController(controller, animated: true, completion: nil)
}