We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
convenience init
Hello I was wondering how following Swift code could be generated:
extension UIColor { public convenience init(hex: Int, alpha: CGFloat = 1) { let components = ( r: CGFloat((hex >> 16) & 0xFF) / 255, g: CGFloat((hex >> 08) & 0xFF) / 255, b: CGFloat((hex >> 00) & 0xFF) / 255 ) self.init(red: components.r, green: components.g, blue: components.b, alpha: alpha) } }
I tried following
.addExtension( ExtensionSpec.builder(uiColorType) .addFunction( FunctionSpec.constructorBuilder() .addModifiers(Modifier.PUBLIC) .build() ) .build() )
Which yields the init function but no option to add the convenience keyword.
init
convenience
extension UIColor { public init() { } }
The text was updated successfully, but these errors were encountered:
convience init
Successfully merging a pull request may close this issue.
Hello I was wondering how following Swift code could be generated:
I tried following
Which yields the
init
function but no option to add theconvenience
keyword.The text was updated successfully, but these errors were encountered: