Swift 4 Odd unexpected jump back to earlier storyboard

◇◆丶佛笑我妖孽 提交于 2019-12-02 10:33:17

The problem is that you are using a .partialCurl presented view controller. Don't. You've stumbled on a terrible bug, namely that there is an invisible area of the presented view controller which, if tapped, dismisses the view controller.

I have an elaborate and extremely hacky workaround, though the simplest solution is to avoid .partialCurl entirely. Here it is; put this code into your presented view controller:

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    // workaround for curl bug
    if let grs = self.view.gestureRecognizers {
        for g in grs {
            if NSStringFromClass(type(of:g)).hasSuffix("CurlUpTapGestureRecognizer") {
                g.isEnabled = false
            }
        }
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!