Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling Remove Button later after setting it to false #283

Open
CharlieOxendine opened this issue Jun 17, 2021 · 2 comments
Open

Enabling Remove Button later after setting it to false #283

CharlieOxendine opened this issue Jun 17, 2021 · 2 comments

Comments

@CharlieOxendine
Copy link

CharlieOxendine commented Jun 17, 2021

If you try and use a button to trigger enabling the remove button it will show the extra space for a remove icon, but the icon will be invisible. A work around for this is by calling

interestsTagView.enableRemoveButton = true

in the ViewDidLoad and then, in ViewDidAppear, call

interestsTagView.enableRemoveButton = false

@CharlieOxendine CharlieOxendine changed the title Enabling Remove Button later Enabling Remove Button later after setting it to false Jun 17, 2021
@PaulDowney
Copy link

I got the same problem

@mlichwa
Copy link

mlichwa commented Jan 6, 2022

Looks to me that draw is not called when buttons are initially disabled. One workaround would be to remove the body of the draw function from the CloseButton() completely and instead use something similar to:
self.removeButton.setImage(UIImage(systemName: "trash"), for: .normal) to draw a trash icon.
You can add that line in the TagView class inside of a public init(title: String) function.

Here is how my public init(title: String) looks:

public init(title: String) { super.init(frame: CGRect.zero) setTitle(title, for: UIControl.State()) setupView() self.removeButton.setImage(UIImage(systemName: "trash"), for: .normal) }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants