How can I add Swipe Gesture to AVPlayer in swift 3

前端 未结 4 828
天命终不由人
天命终不由人 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:56

    You should do this:playerController.view.addSubview(self.sView) instead of self.view.addSubview(sView)

    And you should add self as tagart just like this: let swipeRight = UISwipeGestureRecognizer(target: self, action: #selector(respondToSwipeGesture))

    It will work . This is my console:https://i.stack.imgur.com/agaBx.jpg

提交回复
热议问题