Currently i'm doing like this,
Calling selector as:
NSTimer.scheduledTimerWithTimeInterval(0.5, target: self, selector: "startAnimation:", userInfo: loadingView, repeats: true)
Selector method is as:
private class func startAnimation(timer:NSTimer){
var loadingCircularView = timer.userInfo as UIView
}
I'm getting warning, and app crashes:
warning: object 0x67c98 of class ‘ClassName’ does not implement methodSignatureForSelector: -- trouble ahead Unrecognized selector +[ClassName startAnimation:]
private
keyword didn't help.@objc
to the start of the method definition (as well as making it non-private
) - though I'm unsure if a class method could still be a target/selector. Alsoself
in this instance, unless you're in a class method is an instance.