ios - Error "$T5??' does not have a member named 'Generator'" in Swift? -
I'm trying to use allContactedBodies () in Swift but I get the error I am class sensation: sqnd {override init} {super intrate ()} How can I fix this I can use all the contracted bodies () ? or "let's go." '$ T5 ??' Class 'generator' :
expected init (Coder: NSCoder) {fatalError ("NSCoding is not supported")} init (Size: CGSize) {// initial size super.init () / physical properties self.physicsBody = SKPhysicsBody (rectangleOfSize: size) self.physicsBody?. influenced? Bigverity = false self. PhysicsBody ?. Categicbitmask = ColliderType.Vision.toRaw () self.physicsBody? .collisionBitMask = 0 self.physicsBody? .contactTestBitMask = ColliderType.Wall.toRaw () self.hidden = true} Fencon Contact () - & gt; For the body: for Bob: self.physicsBody in the object? .allContactedBodies () {// error return here is true} return false}}
self. PhysicsBody? .all related tasks () gives an alternate return, so due to alternative channeling it makes the whole expression optional. You can either use the fusion operator in zero, in case the
: body. anyObject in physicsBody? .allContactedBodies) ?? <] If the return is wrong then use it to achieve the physical science body in this case, if "let's go"
If PhysicsBody = self.physicsBody {For Body: Any Objectbody in Physics.Older Integrated Bodies (Return)} Return Returns True} Other {Return False} < / Pre>
Comments
Post a Comment