如何在Swift 3中调用函数内部的函数

时间:2017-01-27 19:37:59

标签: function swift3 xcode8 uitapgesturerecognizer

我尝试在tapBlarButton(_ sender: UITapGestureRecognizer)函数中调用函数viewWillAppear,但我不知道该怎么做,这是我的代码:

@IBOutlet weak var buttonFunction: UIButton!

override func viewDidLoad() {
    super.viewDidLoad()

    let tapGesture = UITapGestureRecognizer(target: self, action: #selector(tapBlarButton(_:)))

    buttonFunction.addGestureRecognizer(tapGesture)

}

func tapBlarButton(_ sender: UITapGestureRecognizer) {

    print("Hello! ")

}

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)

    // Here I want to call the function

}

0 个答案:

没有答案