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

'prepare' function is overwritten by private prepare functions #973

Closed
Eric0625 opened this issue Nov 18, 2017 · 4 comments
Closed

'prepare' function is overwritten by private prepare functions #973

Eric0625 opened this issue Nov 18, 2017 · 4 comments

Comments

@Eric0625
Copy link

Eric0625 commented Nov 18, 2017

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'"

default

@Eric0625
Copy link
Author

Eric0625 commented Nov 18, 2017

In the previous version this definition works fine, but now it's of no use to define the title color in prepare()
default

@daniel-jonathan
Copy link
Member

I will investigate this today and release a fix :) Thank you!

@daniel-jonathan
Copy link
Member

This will be in the next release and here is the commit for the fix 6612bfd. Thank you :)

@Eric0625
Copy link
Author

Great, so fast! And you are welcome =)

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

No branches or pull requests

2 participants