0
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
let touchesSet = touches as NSSet
let touch = touchesSet.anyObject() as? UITouch
let location = touch?.location(in: self.view)
if touch!.view == bee1 {
bee1?.center = location!
} else if touch!.view == bee2 {
bee2?.center = location!
}
}
我需要代码,这个游戏为iOS,用斯威夫特;但我不知道如何使用Swift将图像应用到图像上。我迄今为止的尝试都失败了; touch!.view!=图片
使用手势或使用按钮和应用图像到该按钮 – Joe
尝试添加“用户交互启用“给你的蜜蜂图像。 – Pochi
你究竟想达到什么目的? – PGDev