我的目标是iOS 10,无法决定我应该选择哪种方法以及为什么?由于以下两个代码都返回了对象数组。
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
let touch: UITouch = touches.first!
let location: CGPoint = touch.location(in: self)
let node: SKNode = self.atPoint(location)
let duration = 0.25
if node == selectButton {
setNewPlayerSprite(nameOfPlayer: (centerPlayer?.name)!)
} else if node == lockedButton || node == priceLabel {
unlockPlayer(nameOfPlayer: (centerPlayer?.name)!)
} else if node == otherButton {
getSpecialUnlockData()
} else if node == purchaseButton || node == purchasePriceLabe {
purchaseCharacter(ID: characterProductID)
} else if node == buyButton {
giveItemAmount(itemName: "Item2", giveAmount: 1)
}