Ios Swift 2 为选择器传递第二个参数
Ios Swift 2 passing second argument for selector
我正在尝试在调用选择器时添加第二个参数,谁能告诉我具体怎么做
我试过了:
let BtnVar = UIButton(title: "TrlTxt",
style: UIBarButtonItemStyle.Plain,
target: self,
action: #selector(self.NavRitBtnKlk(_:, Nam2Var)))
func NavLitBtnKlk(sender: UIButton, Nam1PsgVar: AnyObject)
{
/* CodTdo */
print("Clicked")
}
选择器应该是
#selector(self.NavRitBtnKlk(_:Nam1PsgVar:))
我正在尝试在调用选择器时添加第二个参数,谁能告诉我具体怎么做
我试过了:
let BtnVar = UIButton(title: "TrlTxt",
style: UIBarButtonItemStyle.Plain,
target: self,
action: #selector(self.NavRitBtnKlk(_:, Nam2Var)))
func NavLitBtnKlk(sender: UIButton, Nam1PsgVar: AnyObject)
{
/* CodTdo */
print("Clicked")
}
选择器应该是
#selector(self.NavRitBtnKlk(_:Nam1PsgVar:))