我正在尝试在调用选择器时添加第二个参数,谁能告诉我如何准确地做到这一点
我试过了:
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)
关于Ios Swift 2 为选择器传递第二个参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37993742/
欢迎光临 OGeek|极客世界-中国程序员成长平台 (https://ogeek.cn/) | Powered by Discuz! X3.4 |