LoginSignup
0
0

More than 5 years have passed since last update.

一回しかaddTargetしてないはずのUIButtonのタッチイベントが2回呼ばれる

Last updated at Posted at 2017-11-14

UIButtonを押した時のイベントハンドラをaddTargetで設定したのだけど、なぜかイベントが2回呼ばれる。コードを何度見ても1回しか登録していないのに・・・何が起きているんだ!

ikari256.png


backButton.addTarget(self, action: #selector(didTapBackButton), for: .touchDragInside)

odoroki256.png


_人人人人人人人人人人人人人人人人人_
>        touchDragInside      <
 ̄Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y ̄

もちろんtouchUpInsideに変更して事なきを得ました。くだらないことですが、納期に追われテンパってると意外とこういうことで他の人もハマるかもしれないので書いておきます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0