ios - Swift: Undefined symbols for architecture i386: "_OBJC_CLASS_$_CGColor" -
ios - Swift: Undefined symbols for architecture i386: "_OBJC_CLASS_$_CGColor" -
i'm trying animate background color of view. in animationdidstop
delegate method seek set final background color using tovalue
property of cabasicanimation
object. code seems right in editor when compile project linker doesn't find cgcolor
class. code works if omit uicolor(cgcolor: animation.tovalue cgcolor!
) look (for illustration using const uicolor
)
class viewcontroller: uiviewcontroller { @ibaction func colorselected(sender: uibutton) { allow animation = cabasicanimation(keypath: "backgroundcolor") animation.tovalue = sender.backgroundcolor.cgcolor animation.delegate = self self.view.layer.addanimation(animation, forkey: "fadeanimation") } @objc override func animationdidstop(anim: caanimation!, finished flag: bool) { allow animation = anim cabasicanimation self.view.backgroundcolor = uicolor(cgcolor: animation.tovalue cgcolor!) } }
update: xcode 6 beta 3 code compiles exception raised in method swift_dynamiccastunknownclassunconditional
tovalue
property casted cgcolor
.
this weird behavior seems related xcode issue.
remember class cgcolorref
, not cgcolor. cgcolor property on uicolor cgcolorref [uicolor redcolor].cgcolor
ios core-animation swift cgcolor
Comments
Post a Comment