LoginSignup
8
1

More than 5 years have passed since last update.

IBActionの引数が邪魔だと思ったら

Posted at

UIButtonやUIControlなどのIBActionを紐付けすると引数が自動でついてくる。

    @IBAction private func Tap(_ sender: Any) {
        ...
    }

しかし、UIButtonではこの引数は大半使わないしできるなら消したい。

そういうときは以下のようすると自動で引数がつかなくなります。

Interface BuilderからIBActionを紐付けするときにArgumentの項目をNoneにする
スクリーンショット 2017-04-12 11.31.14.png

UIGestureRecognizerではこの方法は使えませんでした。

8
1
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
8
1