core image - Swift: Instance variable takes precedence over class constructor? -
i'm having issue while attempting extend uiimage. i'm creating new method part of processing creates ciimage. unfortunately since uiimage contains instance variable name ciimage, compiler seems think constructor trying reference instance variable rather ciimage class:
extension uiimage { func newmethod() { let image = ciimage(cgimage: self.cgimage) // error: cannot invoke 'ciimage' argument list of type '(cgimage: cgimage!)' } }
is there workaround call ciimage constructor within context of uiimage extension?
you can reference type explicitly prefacing module name.
extension uiimage { func newmethod() { let image = coreimage.ciimage(cgimage: self.cgimage) } }
Comments
Post a Comment