cocoa touch - Touches Began not working with Swift 3.0 on Xcode 8.0 beta -
i making game swift 3.0 on xcode 8.0 beta. in gamescene have touchbegan
function:
override func touchesbegan(_ touches: set<uitouch>, event: uievent?) { t in touches { let location = t.location(in: self) let nodeattouch = self.atpoint(location) let touchedsprite = nodeattouch as! skspritenode print("touch detected") if touchedsprite skbutton { print("button touched") touchedsprite.run(skaction.resize(bywidth: 25, height: 25, duration: 0.25)) } } }
for strange reason print on line 6 doesn't print out when touch screen, therefore meaning touch not being detected. ideas or fixes, else having problem? in advance.
Comments
Post a Comment