antiraum/THPinViewController — pull request #17 by nilsgrabenhorst (2014-12-18 14:38:27+00:00)
Title: Fixes an issue that caused the cancel button title to be shown briefly b...

Hi Thomas,
The bottom button was briefly showing the cancel title before replacing it with the delete title even when the cancel button is hidden. It's just a small cosmetic issue. Apparently the titles of UIButtons don't update immediately when calling -setTitle:forState:.

I fixed this by having two separate buttons instead, one for deleting and one for cancelling. They are hidden/shown when appropriate. This adds a bit of complexity by having to manage these buttons. That's why I added a new view class that contains the two buttons. On the other hand a bit of complexity is removed by not having to juggle the titles and target/actions.

Cheers,
nils