Because title for normal state is being stored in internal storedTitle before collapse animation
And storedTitle is used in the animation completion that is un-accessible outside the class, one should set the title BEFORE the animation, and if changing it during (or after) the animation, backToDefaults will cause the original title to return no matter what was set.
The only patch outside the class is changing the title with dispatch_delay after the animation. A solution in the app would be simply adding:
override open func setTitle(_ title: String?, for state: UIControlState) { super.setTitle(title, for: state) self.storedTitle = title }
Because title for normal state is being stored in internal storedTitle before collapse animation
And storedTitle is used in the animation completion that is un-accessible outside the class, one should set the title BEFORE the animation, and if changing it during (or after) the animation, backToDefaults will cause the original title to return no matter what was set.
The only patch outside the class is changing the title with dispatch_delay after the animation. A solution in the app would be simply adding:
override open func setTitle(_ title: String?, for state: UIControlState) { super.setTitle(title, for: state) self.storedTitle = title }