Skip to content

Commit 19a9db9

Browse files
committed
Conform View to Toucheable protocol
1 parent 5bb8fd3 commit 19a9db9

File tree

1 file changed

+6
-32
lines changed

1 file changed

+6
-32
lines changed

Classes/Views/View.swift

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import UIKit
22

33
public typealias UView = View
4-
open class View: UIView, UIViewable, DeclarativeProtocolInternal {
4+
open class View: UIView, UIViewable, DeclarativeProtocolInternal, _Toucheable {
55
public var declarativeView: View { self }
66
public lazy var properties = Properties<View>()
77
lazy var _properties = PropertiesInternal()
@@ -67,38 +67,12 @@ open class View: UIView, UIViewable, DeclarativeProtocolInternal {
6767

6868
open func buildView() {}
6969

70-
// MARK: Touches
70+
// MARK: Toucheable
7171

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?
10276

10377
override open func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
10478
super.touchesBegan(touches, with: event)

0 commit comments

Comments
 (0)