Ios Swift 2 为选择器传递第二个参数
<p><p>我正在尝试在调用选择器时添加第二个参数,谁能告诉我如何准确地做到这一点<br/>
<br/>
我试过了:</p>
<pre><code>let BtnVar = UIButton(title: "TrlTxt",
style: UIBarButtonItemStyle.Plain,
target: self,
action: #selector(self.NavRitBtnKlk(_:, Nam2Var)))
func NavLitBtnKlk(sender: UIButton, Nam1PsgVar: AnyObject)
{
/* CodTdo */
print("Clicked")
}
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>选择器应该是</p>
<pre><code>#selector(self.NavRitBtnKlk(_:Nam1PsgVar:))
</code></pre></p>
<p style="font-size: 20px;">关于Ios Swift 2 为选择器传递第二个参数,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/37993742/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/37993742/
</a>
</p>
页:
[1]