Bar Button Item not working on iOS 12.4.1 when compiled with XCode 11

Hi,


I am facing an issue with Navigation Bar button item. The action associated with a UIButton in the Bar Button Item subview is not invoked when i tap on the it.


The behaviour is fine in the following combinations:


- iOS 13 with XCode 11

- iOS 12.4.1 with XCode 10


However when i compile my code in XCode 11 and install on iOS 12.4.1, the button doesnt work. Is this a known issue? Any suggestion is welcome. Thanks in advance.

Answered by amit.thakur in 391115022

Thanks for the response Claude.


The actual view in the UIBarButtonItem was not rendered correctly. I have changed the UI stack and constraints. Its working now.

Could you show the code ? There is probably some issue in it.

I have added a Left Bar Button Item to a UIViewController Navigation Bar. The Bar Button Item has a UIView as subview which has button. The UIButton is assigned a selector using code. It a combination of Storyboard and a single line of code for assigning the action to the button.


Whats intiguing is that it works fine when compiled with XCode 10.3. It has been working fine for few years now. It also works fine when compiled by XCode 11 and deployed on iOS 13. The issue only occurs when i install on iOS 12.4 from XCode 11.


Thanks for the response.

The issue only occurs when i install on iOS 12.4 from XCode 11.

On simulator or on device, or both ?


Where do you assign the action to the button, in which func ?


Could you post this part of code ?

Accepted Answer

Thanks for the response Claude.


The actual view in the UIBarButtonItem was not rendered correctly. I have changed the UI stack and constraints. Its working now.

Bar Button Item not working on iOS 12.4.1 when compiled with XCode 11
 
 
Q