IOS11 UIBarButtonItem not working

I have an application that is available in the store. I am trying to prepare it for the release of iOS11, but have run into an annoying problem.

None of the UIBarButtonItemin-app works properly. LeftBarButtonItems elements are clickable, but the click area is slightly to the right of the element. RightBarButtonItems do not work at all! I added elements both through the storyboard and through the code, but none of them seem to work. Please, help!

Here is an example: -

navigationItem.rightBarButtonItem = UIBarButtonItem(title: NSLocalizedString("Save", comment: "save button title"), style: UIBarButtonItemStyle.plain, target: self, action: #selector(VC.rightBarButtonClicked(_:)))
+4
source share
3 answers

. UIButton "UIButton + MinimumTouchArea.swift" , UIButton.hitTest UIBarButtonItem iOS 11. , !

+6

iOS11 UIBarButtonItem

, , xcode 8.3 ( ios11, 8.3, )

Xcode 8 iOS 11, ios11 xcode 8.3

+1

, iOS 11, .

interactivePopGestureRecognizer

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

,

 func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
        guard gestureRecognizer == interactivePopGestureRecognizer else {
            return true // default value
        }

        // Write you code here.
    }
0
source

Source: https://habr.com/ru/post/1685876/


All Articles