Skip to content

Button title needs to be set before collapse animation #2

@renenel

Description

@renenel

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 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions