Swift for-loop wont accept index as a variable multiplied with a size.widht value -


code:

the issue: im not allowed operate index size.widht. know cg value allowed operate literals. however, when try use declared int instead doesnt allows either.

size.widht/5 * (index + 1) says "cannot invoke '+' argument list of type '($t6,($t10))'.

func addbricks(cgsize) {     var index = 0; index < 4; index++ {     var brick = skspritenode(imagenamed: "brick")     brick.physicsbody = skphysiscsbody(rectangleofsize: brick.frame.size)      var xpos = size.widht/5 * (index + 1)     var ypos = size.height - 50     brick.position = cgpointmake(xpos, ypos)     self.addchild(brick)     } } 

what possible wrong?


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -