2016-05-12 207 views
-2

我在swift 2代碼中有兩個函數。Swift - 將相同的參數從一個函數傳遞給另一個函數

func myfunctionA (sender: UIButton!){ 

// some code 

myfunctionB (sender: UIButton!) } 

其他函數是func myfunctionB。 我從myfunctionA內部調用myfunctionB。

我需要知道如何將相同的發件人參數從myfunctionA傳遞給myfunctionB。

+0

可否請你讓我知道爲什麼這個問題是下投票。提前致謝。 – user2994762

回答

1
func myfunctionA (sender: UIButton!){ 
    myfunctionB(sender); 
} 

應該工作

+0

謝謝。其實它是myfunctionB(發件人)。 The;不需要。 – user2994762

相關問題