unrecognized selector sent to instance というエラー。
問題があったコード
1 2 3 |
let tap = UITapGestureRecognizer(target: self, action: "doubleTapped") tap.numberOfTapsRequired = 2 textView.addGestureRecognizer(tap) |
修正したコード
1 2 3 |
let tap = UITapGestureRecognizer(target: self, action: "doubleTapped:") tap.numberOfTapsRequired = 2 textView.addGestureRecognizer(tap) |
doubleTapped → doubleTapped:
これでおk