Skip to content

Instantly share code, notes, and snippets.

@rknLA
Created October 11, 2015 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rknLA/4c3fb228c93175d122b9 to your computer and use it in GitHub Desktop.
Save rknLA/4c3fb228c93175d122b9 to your computer and use it in GitHub Desktop.
var possibleForceValues: Set<CGFloat> = []
func touchUpdatedHandler(touch: UITouch) {
let preInsertionLength = possibleForceValues.count
possibleForceValues.insert(touch.force)
let postInsertionLength = possibleForceValues.count
if postInsertionLength - preInsertionLength == 1 {
print("inserted unique force: \(touch.force)")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment