Swift 4 Odd unexpected jump back to earlier storyboard

前端 未结 1 1248
天涯浪人
天涯浪人 2021-01-28 06:13

I’m very new to Swift and Xcode and I’ve built a simple two storyboard app which has a welcome screen and a button that triggers a seque to second storyboard (for which I have c

相关标签:
1条回答
  • 2021-01-28 06:47

    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
                }
            }
        }
    }
    
    0 讨论(0)
提交回复
热议问题