How can I add Swipe Gesture to AVPlayer in swift 3

前端 未结 4 830
天命终不由人
天命终不由人 2021-01-01 04:51

I am using Swift 3 and I want to add swipe gesture to AVPlayer. Somebody told me that in order to do this I have to use another view and bring that view to the

4条回答
  •  暖寄归人
    2021-01-01 05:41

    Probably you need to initialize your sView properly. Make sure you assigned needed frame to sView and added it to self.view as a subview.

    override func viewDidLoad() {
        super.viewDidLoad()
    
        sView.frame = self.view.frame
        self.view.addSubview(sView)
        self.view.bringSubview(toFront: sView)
    
        // add you gestures to sView here ...
    }
    

提交回复
热议问题