UIBarButtonItem not clickable on iOS 11 beta 7?

I have these 2

UIButton
s that are grouped inside a
UIView
. This UIView is put inside a
UIBarButtonItem
and the whole thing is set as
Left Bar Button Items
, using Interface Builder.


Each button, when clicked, show a popover, triggered by storyboard.


I am testing this on an iPad 3, running iOS 9, using Xcode 8. This works wonderfully.


Now I have decided to test this on my iPad Pro 9.7" that is running iOS 11 beta 7. I am using Xcode 9 beta 6. When I run this on the iPad Pro, all buttons on the navigation bar are dead. They don't respond to clicks. Now I try the same Xcode 9 beta 6 and run the app on the iPad 3 with iOS 9 and again, all work wonderfully.


I am compiling for iOS 9.1.


Buttons not even highlight to acknowledge the tap, as they do on iOS 9.


Is there an issue with iOS 11 beta 7 and bar button items?


Any ideas?

As per the documentation:

convenience init(customView: UIView)

The bar button item created by this method does not call the action method of its target in response to user interactions. Instead, the bar button item expects the specified custom view to handle any user interactions and provide an appropriate response.


Either you need to handle user interactions within your custom view that holds the 2 UIButtons or you need to add the 2 UIButtons directly as UIBarButtonItem's customView.

i believe I have the same problem, but using the rightBarButtonItem.


I have these 2

UIButton
s that are grouped inside a
UIView
. This UIView is put inside a
UIBarButtonItem
and the whole thing is set as
Left Bar Button Items
, using Interface Builder.


I have the same situation - 2 buttons grouped inside a UIView. The UIView is set as a customView for a UIBarButtonItem, which is set as the rightBarButtonItem.


Buttons are now non-responsive, worked fine with XCode 8 and iOS10 SDK.


What I find is that the UIView which contains the 2 buttons has its size changed to 0,0. The size should be 102 x 50 (in my setup) - I verified this using the Debug View Hierarchy in XCode. My 2 buttons remain visible UNLESS I set the containing UIView to enable clipToBounds, then the 2 buttons disappear as expected, since the containing view has no width and no height.


I've tried manually setting the width and height again, but so far nothing has worked. You should be able to verify if this is the same problem by setting the background color of the UIView which contains the 2 buttons to an obvious color like red. On XCode8 I see the red background, and the buttons work, the containing view is the correct size.

I have the same issue, which is still appearing in iOS 11 beta 10.

It first appeared somewhere around beta 2 or 3.


Tried everything, adding an action on the UIBarButtonItem, an UITapGestureRecognizer on its custom view, a target-action on its UIButton subview...

A custom tap gesture may be interfering with the UIBarButtonItem. I had the same issue with a tap gesture added to the main view of a tab managed by UITabBarController. When I tapped on the button, it would always fire the main view tap gesture instead, ignoring the bar button on the navigation bar above the main view. I fixed the issue by unchecking "Cancels touches in view" my tap gesture recognizer in interface builder.

Has anyone figured this out yet?


I have a UIButton inside a custom view in a bar button item and it no longer responds to taps in iOS 11 (works fine in iOS 10). Here's a screenshot of my storyboard hierarchy: http://d.pr/i/FduhN

awesome! thank you!


on tuesday of this week i updated to xcode 9 and navigation bar is acting differently. Anyway, i had a i created a UITapGestureRecognizer to cancel keyboard.


my new code looks like:


let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(manualAdd.dismissKeyboard))
tap.cancelsTouchesInView = false  // this line is required for xcode 9
view.addGestureRecognizer(tap)



and now my navigation buttons and tool bar buttons are clickable.

I've been having issues with tap gesture recognizers and the navigation item. I filed a radar about it: rdar://34790205 (https://openradar.appspot.com/radar?id=6170201875808256)

UIBarButtonItem not clickable on iOS 11 beta 7?
 
 
Q