こんにちは
例えばですが、UIButtonをクリックした時のイベントで、
その要素から特別な値を取得したいなどの理由でカスタムプロパティなるものを設定することはできますか?
swift
1 //例 この形を作りたい 2 let button = UIButton() 3 button.customproperty = 2 4 5 @objc func buttonTapped(sender : UIButton) { 6 if sender.customproperty > 1{ 7 print("テスト") 8 } 9 }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。