iOS11 UIBarButtonItem not working

后端 未结 3 1389
抹茶落季
抹茶落季 2021-01-13 22:32

I have an app that is live in the store. I am trying to get it ready for the iOS11 release but have run into an annoying problem.

None of the UIBarButtonItem

相关标签:
3条回答
  • 2021-01-13 23:26

    Had the same issue. It came down to an extension on UIButton in a file called "UIButton+MinimumTouchArea.swift" in our project which overrides UIButton.hitTest and breaks UIBarButtonItem in iOS 11. It took us a the whole day to figure out!

    0 讨论(0)
  • 2021-01-13 23:27

    Yes there bug in iOS 11 so you can use another way for it.

    Use interactivePopGestureRecognizer like

     self.navigationController?.interactivePopGestureRecognizer?.delegate = self as! UIGestureRecognizerDelegate
    

    and implement delegate method like

     func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
            guard gestureRecognizer == interactivePopGestureRecognizer else {
                return true // default value
            }
    
            // Write you code here.
        }
    
    0 讨论(0)
  • 2021-01-13 23:31

    iOS11 UIBarButtonItem action not get called

    ran into the same, solution for me was to build with xcode 8.3 instead (devices with ios11 running the app build by 8.3 worked great)

    Use Xcode 8 with iOS 11 you can use this workaround to debug ios11 devices on xcode 8.3

    0 讨论(0)
提交回复
热议问题