You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can reproduce this by adding the following line to the sample project:
letawesomeButton=SimpleButton.buttonWithType(.Custom)as!SimpleButton
awesomeButton.enabled = false //add this
If you run the project with that line in place, you will see that the awesomButton is not visible. Its attributes are set properly, but it hasn't been updated visually.
The problem is caused by the following check:
if state == self.state
When you call e.g. setBackgroundColor, and button's state is .Disabled, but the attributes are set for .Normal. Thus, the method changeBackgroundColorForStateChange is not called and the button's appearance is not updated.
I wasn't sure if the above check is needed for performance reasons or if you can just get rid it.
The text was updated successfully, but these errors were encountered:
You can reproduce this by adding the following line to the sample project:
If you run the project with that line in place, you will see that the awesomButton is not visible. Its attributes are set properly, but it hasn't been updated visually.
The problem is caused by the following check:
When you call e.g.
setBackgroundColor
, and button's state is .Disabled, but the attributes are set for .Normal. Thus, the methodchangeBackgroundColorForStateChange
is not called and the button's appearance is not updated.I wasn't sure if the above check is needed for performance reasons or if you can just get rid it.
The text was updated successfully, but these errors were encountered: