1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-09-17 16:07:44 +03:00
Macaw/Source/views/Touchable.swift
2017-08-23 12:29:45 +07:00

27 lines
606 B
Swift

class MTouchEvent: Hashable {
let id: Int
let x: Double
let y: Double
init(x: Double, y: Double, id: Int) {
self.x = x
self.y = y
self.id = id
}
public var hashValue: Int {
return id.hashValue
}
public static func ==(lhs: MTouchEvent, rhs: MTouchEvent) -> Bool {
return lhs.id == rhs.id
}
}
protocol Touchable {
func mTouchesBegan(_ touches: [MTouchEvent])
func mTouchesMoved(_ touches: [MTouchEvent])
func mTouchesEnded(_ touches: [MTouchEvent])
func mTouchesCancelled(_ touches: [MTouchEvent])
}