I have a navigation controller, in its navigation bar i’ve 2 right bar button items, I want to disable one right bar button when the other is being clicked/tapped. How to achieve this??
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unfortunately
UIBarButtonItemsonly have one callback and that’s the equivalent ofUIButton‘sUIControlEventTouchUpInside.If you want to do something when the user presses and releases a button (disable/re-enable other buttons) you might have to get your hands dirty with some custom
UIBarButtonItemsthat haveUIButton'sascustomViewand do some careful event handling to know when to enable/disable each.On a personal note: pressing more than one bar button at the same time is not very common and shouldn’t present a problem, whatever implementation you may have.