I have a custom accessory view (a UIButton) on my prototype cell in a storyboard. When I click that button the delegate method for accessory button tapped isn't called. If I use a standard disclosure button it is called just fine. I'm assuming I'm missing a hook up somewhere. Anybody know where?
Guess 1:
You don't really have a "custom accessory view" you have a UIButton
which is placed where an accessory would go. This wouldn't fire the delegate accessory tapped button because it's not really an accessory.
Guess 2:
You do have a real accessory view, but it's never getting the "tap" event because you have a UIButton
in it which is eating the user interaction but not firing an action. In that case try adding a simple UIView
instead.
Other than that, I'd need more information.
apple docs for the accessory delegate method says
The delegate usually responds to the tap on the disclosure button (the accessory view) by displaying a new view related to the selected row. This method is not called when an accessory view is set for the row at indexPath.
so it is not called for custom accessory views. it is a standard behaviour.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With