ios - Setting up CIFilter in Swift -
how 1 translate lastly line of next objc code swift:
cgaffinetransform transform = cgaffinetransformidentity; cifilter *clampfilter = [cifilter filterwithname:@"ciaffineclamp"]; [clampfilter setvalue:[nsvalue valuewithbytes:&transform objctype:@encode(cgaffinetransform)] forkey:@"inputtransform"];
the next line
clampfilter.setvalue(transform, forkey: "inputtransform")
produces
type 'cgaffinetransform' not conform protocol 'anyobject'
nsvalue
has constructor takes cgaffinetransform
argument:
let transform = cgaffinetransformidentity allow clampfilter = cifilter(name: "ciaffineclamp") allow val = nsvalue(cgaffinetransform: transform) clampfilter.setvalue(val, forkey: "inputtransform")
ios objective-c swift core-image
No comments:
Post a Comment