UILongPressGestureRecognizer没有运行功能

时间:2016-06-12 18:53:42

标签: ios swift user-interface uilongpressgesturerecogni

在我的viewdidload()中我像这样初始化了longpressgesturerecognizer

override func viewDidLoad() {
    super.viewDidLoad()
    let lpgr = UILongPressGestureRecognizer(target: self, action: "action:")

    lpgr.minimumPressDuration = 2.0

    Capture.addGestureRecognizer(lpgr)

    // Do any additional setup after loading the view.
}

然后我尝试运行此功能,该功能稍后将成为相机的录制按钮

func action(gestureRecognizer:UIGestureRecognizer) {
    print("pressed")

}
@IBOutlet weak var Capture: UIProgressView!

0 个答案:

没有答案