|
1 | 1 | import UIKit |
2 | 2 |
|
3 | 3 | public typealias UView = View |
4 | | -open class View: UIView, UIViewable, DeclarativeProtocolInternal { |
| 4 | +open class View: UIView, UIViewable, DeclarativeProtocolInternal, _Toucheable { |
5 | 5 | public var declarativeView: View { self } |
6 | 6 | public lazy var properties = Properties<View>() |
7 | 7 | lazy var _properties = PropertiesInternal() |
@@ -67,38 +67,12 @@ open class View: UIView, UIViewable, DeclarativeProtocolInternal { |
67 | 67 |
|
68 | 68 | open func buildView() {} |
69 | 69 |
|
70 | | - // MARK: Touches |
| 70 | + // MARK: Toucheable |
71 | 71 |
|
72 | | - public typealias TouchClosure = (Set<UITouch>, UIEvent?) -> Void |
73 | | - |
74 | | - private var _touchesBegan: TouchClosure? |
75 | | - private var _touchesMoved: TouchClosure? |
76 | | - private var _touchesEnded: TouchClosure? |
77 | | - private var _touchesCancelled: TouchClosure? |
78 | | - |
79 | | - @discardableResult |
80 | | - public func touchesBegan(_ closure: @escaping TouchClosure) -> Self { |
81 | | - _touchesBegan = closure |
82 | | - return self |
83 | | - } |
84 | | - |
85 | | - @discardableResult |
86 | | - public func touchesMoved(_ closure: @escaping TouchClosure) -> Self { |
87 | | - _touchesBegan = closure |
88 | | - return self |
89 | | - } |
90 | | - |
91 | | - @discardableResult |
92 | | - public func touchesEnded(_ closure: @escaping TouchClosure) -> Self { |
93 | | - _touchesBegan = closure |
94 | | - return self |
95 | | - } |
96 | | - |
97 | | - @discardableResult |
98 | | - public func touchesCancelled(_ closure: @escaping TouchClosure) -> Self { |
99 | | - _touchesBegan = closure |
100 | | - return self |
101 | | - } |
| 72 | + var _touchesBegan: TouchClosure? |
| 73 | + var _touchesMoved: TouchClosure? |
| 74 | + var _touchesEnded: TouchClosure? |
| 75 | + var _touchesCancelled: TouchClosure? |
102 | 76 |
|
103 | 77 | override open func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { |
104 | 78 | super.touchesBegan(touches, with: event) |
|
0 commit comments