vendredi 20 novembre 2015

If TouchLocation is NOT Within Bounds

For the below code, I need to see whether the touchLoaction is not within the bounds of a button, but the problem I have is a can't use !=, so I'm not 100% sure of what I need to enter instead. Every time I search the web for "if not equal", it only brings up the "!=" example, which doesn't work in this instance.

let touch = touches.first as UITouch!
let touchLocation = touch.locationInNode(self)

if button.containsPoint(touchLocation) { // NEEDS TO BE NOT CONTAINSPOINT OR SOMETHING

   print("not on button")

}

Aucun commentaire:

Enregistrer un commentaire