ios - beginner xcode swift sprite kit - remove sprite by name crash -
ios - beginner xcode swift sprite kit - remove sprite by name crash -
i'm trying remove sprites when nail bottom. works if don't check name removes background too. when seek add together name if
crashes.
func checkifbotsreachbottom() { kid in self.children { if (child.position.y == 0 && child.name == "botone") { self.removechildreninarray([child]) } } }
this crashes, if remove child.name
part doesn't.
self.children
returns [anyobject]
. if cast [sknode]
should fine:
func checkifbotsreachbottom(){ kid in self.children [sknode] { if (child.position.y == 0 && child.name == "botone") { self.removechildreninarray([child]) } } }
ios xcode swift sprite
Comments
Post a Comment