Assuming you can get a reference to the button, you should be able to call addTarget:action:forControlEvents:
to add another action.
I discovered by accident that you could do this to a UIButton
when I was (I thought) replacing actions on a button depending on the state of the UI, but I was in fact adding actions to buttons. This is when I learned about removeTarget:action:forControlEvents:
. :-)
That all being said, if you have a button that says "Cancel", and you overload it with something extra that is user-visible, this might be confusing to the user. If you simply want something to happen in the background when the user taps cancel, then this is an interesting way to get it done! I like that.