In iOS 7 my UIButton titles are animating in and out at the wrong time - late. This problem does not appear on iOS 6. I\'m just using:
[self setTitle:text fo
I’ve made a Swift extension to do this:
extension UIButton {
func setTitleWithoutAnimation(title: String?) {
UIView.setAnimationsEnabled(false)
setTitle(title, forState: .Normal)
layoutIfNeeded()
UIView.setAnimationsEnabled(true)
}
}
Works for me on iOS 8 and 9, with UIButtonTypeSystem
.
(The code is for Swift 2, Swift 3 and Objective-C should be similar)