0
在像C或Java,其他語言,如果我要停止執行的方法和返回值我喜歡下面:如何停止在Swift中執行某個操作?
public void aFunction() {
if(a == b) {
// Do something...
return; // stop here
}
// Do something else
}
如果迅速,我指定動作的按鈕
@IBAction func button_1(sender: AnyObject) {
if a == b
{
// Do something ...
/* I want to stop here but I don't know how */
}
// Do something else
}
如何停止在Action中執行腳本? 謝謝。