在我的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!