在资产目录中,我为 iPhone 和 iPad 设备设置了一个名为“panda”的图像。iPhone 有 3 张图片,iPad 有 2 张图片
当我在装有 iOS 8.4 的 iPad Air、iPad Air 2、iPad Retina、iPad 2 上运行该应用程序时,图像会在点击时显示,但在装有 iOS 9 的 iPad 2 上没有任何反应!
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
/* Called when a touch begins */
for touch in touches {
let location = touch.locationInNode(self)
let sprite = SKSpriteNode(imageNamed:"panda")
print(sprite)
sprite.position = location
let action = SKAction.rotateByAngle(CGFloat(M_PI), duration:1)
sprite.runAction(SKAction.repeatActionForever(action))
self.addChild(sprite)
}
}
使用版本7.0
这里是设置
// 编辑 1.0
显然这是一个错误,尚未修复
https://forums.developer.apple.com/thread/4268 https://forums.developer.apple.com/message/36854#36854