Overriding method with selector ‘touchesEnded:withEvent:’ has incompatible type ‘(NSSet, UIEvent) -> ()’

こういう↓エラーが出る件

Overriding method with selector 'touchesEnded:withEvent:' has incompatible type '(NSSet, UIEvent) -> ()'

swift1.2でtouchesEndedの引数の型が変わった件に関係していて、

override func touchesBegan(touches: NSSet, withEvent event: UIEvent)

引数 touches の型を変更

override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent)

NSSetをSet<NSObject>(ジェネリック)に変更した事でその後のスクリプトも変更しないといけない。

参照させてもらったページ

コメント

  1. […] Overriding method with selector ‘touchesEnded:withEvent:’ has incompatible type ‘(NSSet, UIEve… […]