此代码在XCode 6中没有错误,但在XCode 7(Swift 2)中发生了此错误:
方法不会重写其超类中的任何方法
override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
/* Called when a touch begins */
}
删除override
字时发生此错误:
方法"TouchesStart(:withEvent:)' with Objective-C selector 'touchesBegan:withEvent:' conflicts with method 'touchesBegan(:withEvent:)"来自超类"UIResponder",使用相同的Objective-C Select 器