添加参数addGestureRecognizer?

时间:2016-06-11 14:44:43

标签: swift uitapgesturerecognizer sender

我很抱歉,但标题可能会被错误地编辑......

我的viewDidLoad中有一个if语句:

if segueDestination.isEmpty {
} else {
let path = "somePath"
let gesture = UITapGestureRecognizer(target: self, action: "goToA:")
addXib?.viewOutlet.addGestureRecognizer(gesture)
print(segueDestination)
}

我需要在goToA中访问路径常量:

func goToA(gestureRecognizer: UIGestureRecognizer, sender: AnyObject) {

    print(sender.path)

}

但是我在XCode中得到了“模糊使用'路径'”的错误......我无法理解为什么它会让我发疯!

0 个答案:

没有答案