Skip to content

Instantly share code, notes, and snippets.

@MickaelCruzDB
Created April 28, 2015 15:55
Show Gist options
  • Save MickaelCruzDB/9fc857de263a8ab68ed4 to your computer and use it in GitHub Desktop.
Save MickaelCruzDB/9fc857de263a8ab68ed4 to your computer and use it in GitHub Desktop.
override func touchesMoved(touches: Set<NSObject>, withEvent event: UIEvent) {
let location:CGPoint? = touches.anyObject()?.locationInView(self)
if let loc = location {
if (!CGRectContainsPoint(ScaleRect(self.bounds, n: 2.0), loc))
{
self.highlighted = false
}
}
}
@MickaelCruzDB
Copy link
Author

override func touchesMoved(touches: Set, withEvent event: UIEvent) {
touches.first
let location:CGPoint? = touches.first.locationInView(self)
if let loc = location {
if (!CGRectContainsPoint(ScaleRect(self.bounds, n: 2.0), loc))
{
self.highlighted = false
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment