Commit ee22240b46a55b2c505cc3901c3c9edf992ef91d
1 parent
1adbbb74
横屏支付视图 ,屏蔽各种手势
Showing
1 changed file
with
4 additions
and
13 deletions
metaCode/Classes/Main/HuBiLieHomePage/View/VodDetail/HengPing/CNLiveVodPayView.swift
| ... | ... | @@ -9,7 +9,7 @@ import Foundation |
| 9 | 9 | |
| 10 | 10 | typealias CNLiveVodPayViewPayBlock = ()->Void |
| 11 | 11 | |
| 12 | -class CNLiveVodPayView:UIView{ | |
| 12 | +class CNLiveVodPayView:UIView,UIGestureRecognizerDelegate{ | |
| 13 | 13 | |
| 14 | 14 | var payBlock:CNLiveVodPayViewPayBlock? |
| 15 | 15 | //MARK: - 懒加载 |
| ... | ... | @@ -39,7 +39,6 @@ class CNLiveVodPayView:UIView{ |
| 39 | 39 | backBtn.frame = CGRect(x: 15, y: KStatusBarHeight, width: 60, height: 30) |
| 40 | 40 | return backBtn |
| 41 | 41 | }() |
| 42 | - | |
| 43 | 42 | |
| 44 | 43 | override init(frame: CGRect) { |
| 45 | 44 | super.init(frame: frame) |
| ... | ... | @@ -49,12 +48,11 @@ class CNLiveVodPayView:UIView{ |
| 49 | 48 | self.isMultipleTouchEnabled = true |
| 50 | 49 | |
| 51 | 50 | // 双击手势 |
| 52 | - var doubleTapGesture = UILongPressGestureRecognizer(target: self, action: #selector(doubleTapAction)) | |
| 53 | -// doubleTapGesture.numberOfTapsRequired = 2 // 双击触发 | |
| 51 | + var doubleTapGesture = UITapGestureRecognizer(target: self, action: #selector(doubleTapAction)) | |
| 52 | + doubleTapGesture.numberOfTapsRequired = 2 // 双击触发 | |
| 54 | 53 | doubleTapGesture.delaysTouchesBegan = true |
| 55 | 54 | doubleTapGesture.delaysTouchesEnded = true |
| 56 | 55 | doubleTapGesture.numberOfTouchesRequired = 1 |
| 57 | - doubleTapGesture.numberOfTapsRequired = 2 | |
| 58 | 56 | |
| 59 | 57 | var panGesture = UIPanGestureRecognizer(target: self, action: #selector(panAction)) |
| 60 | 58 | panGesture.delaysTouchesBegan = true |
| ... | ... | @@ -81,15 +79,8 @@ class CNLiveVodPayView:UIView{ |
| 81 | 79 | var longGesture = UILongPressGestureRecognizer(target: self, action: #selector(longPressAction)) |
| 82 | 80 | longGesture.minimumPressDuration = 0.5// 长按触发时间(秒) |
| 83 | 81 | self.addGestureRecognizer(longGesture) |
| 84 | - | |
| 85 | - | |
| 86 | - | |
| 87 | -// // 滑动手势(支持四个方向) | |
| 88 | -// var swipeGesture = UISwipeGestureRecognizer(target: self, action: #selector(swipeAction)) | |
| 89 | -// swipeGesture.direction = [.left, .right , .up , .down] | |
| 90 | -// self.addGestureRecognizer(swipeGesture) | |
| 91 | 82 | } |
| 92 | - | |
| 83 | + | |
| 93 | 84 | required init?(coder: NSCoder) { |
| 94 | 85 | fatalError("init(coder:) has not been implemented") |
| 95 | 86 | } | ... | ... |