这是在swift 3中启动重复计时器的正确方法吗?
```
class ABContactManager : NSObject {
func waitForContactsToLoad(_ onSuccess: @escaping (() -> ())) {
Timer.scheduledTimer(
timeInterval: 0.5,
target: self,
selector: #selector(ABContactManager.timerFired(timer:)),
userInfo: ["callback" : onSuccess],
repeats: true)
}
func timerFired(timer: Timer) {
logInfo("keep polling contacts")
if let userInfo = timer.userInfo as? [String : Any] {
if let onSuccess = userInfo["callback"] as? (() -> ()) {
if self.loadingStatus == .loaded {
logInfo("stop polling -- loaded contacts issue callback")
onSuccess()
timer.invalidate()
}
}
}
}
}
```