NSTimer scheduledTimerWithTimeInterval and target is “class level function”

Solutions Collect From Internet About “NSTimer scheduledTimerWithTimeInterval and target is “class level function””

class MyClass:NSObject{

  class func startTimer(){
    NSTimer.scheduledTimerWithTimeInterval(2.0, target: MyClass.self, selector: "callByTimer:", userInfo: nil, repeats: true)

  }

  class func callByTimer(timer: NSTimer!){
    println("Called")
  }

}

MyClass.startTimer()