Commit ee22240b46a55b2c505cc3901c3c9edf992ef91d

Authored by “张旭”
1 parent 1adbbb74

横屏支付视图 ,屏蔽各种手势

metaCode/Classes/Main/HuBiLieHomePage/View/VodDetail/HengPing/CNLiveVodPayView.swift
@@ -9,7 +9,7 @@ import Foundation @@ -9,7 +9,7 @@ import Foundation
9 9
10 typealias CNLiveVodPayViewPayBlock = ()->Void 10 typealias CNLiveVodPayViewPayBlock = ()->Void
11 11
12 -class CNLiveVodPayView:UIView{ 12 +class CNLiveVodPayView:UIView,UIGestureRecognizerDelegate{
13 13
14 var payBlock:CNLiveVodPayViewPayBlock? 14 var payBlock:CNLiveVodPayViewPayBlock?
15 //MARK: - 懒加载 15 //MARK: - 懒加载
@@ -39,7 +39,6 @@ class CNLiveVodPayView:UIView{ @@ -39,7 +39,6 @@ class CNLiveVodPayView:UIView{
39 backBtn.frame = CGRect(x: 15, y: KStatusBarHeight, width: 60, height: 30) 39 backBtn.frame = CGRect(x: 15, y: KStatusBarHeight, width: 60, height: 30)
40 return backBtn 40 return backBtn
41 }() 41 }()
42 -  
43 42
44 override init(frame: CGRect) { 43 override init(frame: CGRect) {
45 super.init(frame: frame) 44 super.init(frame: frame)
@@ -49,12 +48,11 @@ class CNLiveVodPayView:UIView{ @@ -49,12 +48,11 @@ class CNLiveVodPayView:UIView{
49 self.isMultipleTouchEnabled = true 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 doubleTapGesture.delaysTouchesBegan = true 53 doubleTapGesture.delaysTouchesBegan = true
55 doubleTapGesture.delaysTouchesEnded = true 54 doubleTapGesture.delaysTouchesEnded = true
56 doubleTapGesture.numberOfTouchesRequired = 1 55 doubleTapGesture.numberOfTouchesRequired = 1
57 - doubleTapGesture.numberOfTapsRequired = 2  
58 56
59 var panGesture = UIPanGestureRecognizer(target: self, action: #selector(panAction)) 57 var panGesture = UIPanGestureRecognizer(target: self, action: #selector(panAction))
60 panGesture.delaysTouchesBegan = true 58 panGesture.delaysTouchesBegan = true
@@ -81,15 +79,8 @@ class CNLiveVodPayView:UIView{ @@ -81,15 +79,8 @@ class CNLiveVodPayView:UIView{
81 var longGesture = UILongPressGestureRecognizer(target: self, action: #selector(longPressAction)) 79 var longGesture = UILongPressGestureRecognizer(target: self, action: #selector(longPressAction))
82 longGesture.minimumPressDuration = 0.5// 长按触发时间(秒) 80 longGesture.minimumPressDuration = 0.5// 长按触发时间(秒)
83 self.addGestureRecognizer(longGesture) 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 required init?(coder: NSCoder) { 84 required init?(coder: NSCoder) {
94 fatalError("init(coder:) has not been implemented") 85 fatalError("init(coder:) has not been implemented")
95 } 86 }