目标C中有一个应用程序,我正在转换到Swift。 在Objective C中,我有这个方法: [self.view performSelector:@selector(someSelector) withObject:self afterDelay:0.1f]; 我正在与斯威夫特工作,我不知道如何做到这一点。 我试过了: self.view.performSelector(Selector("someSelector"), withObject: self, afterDelay: 0.1) 这是我得到的错误: 'performSelector' is unavailable: 'performSelector' methods are unavailable 我会用什么来调用afterDelay方法? UPDATE 以下是我最终的结果: extension NSObject { func callSelectorAsync(selector: Selector, object: AnyObject?, delay: NSTimeInterval) -> NSTimer { let timer = NSTimer.scheduledTimerWithTimeInterval(delay, target: self, selector: selector, userInfo: object, repeats: false) return timer } func callSelector(selector: […]