【发布时间】:2016-02-23 02:10:15
【问题描述】:
对于下面的代码,我需要查看 touchLoaction 是否不在按钮的范围内,但我遇到的问题是不能使用!=,所以我不能 100% 确定我需要什么改为输入。每次我在网上搜索“如果不相等”时,它只会显示“!=”示例,在这种情况下不起作用。
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")
}
【问题讨论】:
标签: swift if-statement sprite-kit contains