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
When inheriting from FlatButton, it's no use to override prepare() to customize the title color of the button. Because when initialize the child Button with init(title: String?, titleColor: UIColor = Color.blue.base), the prepare function is called first in the super.init function, then followed by prepare(with: title, titleColor: titleColor) which will reset titleColor to the default blue color.
And when I seek to call Button class's initializer in the init function of my custom Button class, the complier pops up the error: "Must call a designated initializer of the superclass 'FlatButton'"
The text was updated successfully, but these errors were encountered:
When inheriting from FlatButton, it's no use to override
prepare()
to customize the title color of the button. Because when initialize the child Button withinit(title: String?, titleColor: UIColor = Color.blue.base)
, the prepare function is called first in the super.init function, then followed byprepare(with: title, titleColor: titleColor)
which will reset titleColor to the default blue color.And when I seek to call Button class's initializer in the init function of my custom Button class, the complier pops up the error: "Must call a designated initializer of the superclass 'FlatButton'"
The text was updated successfully, but these errors were encountered: