【问题标题】:Swift - pass the same parameter from one function to the otherSwift - 将相同的参数从一个函数传递给另一个函数
【发布时间】:2016-05-12 17:25:07
【问题描述】:

我在 swift 2 代码中有两个函数。

func myfunctionA (sender: UIButton!){

// some code

myfunctionB (sender: UIButton!) }

另一个函数是func myfunctionB。 我从 myfunctionA 内部调用 myfunctionB。

我需要知道如何将相同的 sender 参数从 myfunctionA 传递到 myfunctionB。

【问题讨论】:

  • 能否请您告诉我为什么这个问题被否决。提前致谢。

标签: ios function parameters swift2 parameter-passing


【解决方案1】:
func myfunctionA (sender: UIButton!){
  myfunctionB(sender);
}

应该有效

【讨论】:

  • 谢谢。实际上是 myfunctionB(sender)。这 ;不需要。
猜你喜欢
  • 1970-01-01
  • 2015-05-09
  • 2012-08-02
  • 2012-09-25
  • 2020-10-03
  • 2014-01-06
  • 2019-10-09
  • 1970-01-01
相关资源
最近更新 更多