Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var parentNode = SKNode()
- var childNode1 = SKSpriteNode()
- var childNode2 = SKSpriteNode()
- self.addChild(parentNode)
- parentNode.addChild(childNode1)
- parentNode.addChild(childNode2)
- for child in parentNode.children as! [SKNode] {
- // ...
- }
- for child in parentNode.children {
- if let spriteNode = child as? SKSpriteNode {
- // ...
- }
- }
- for case let child as SKSpriteNode in parentNode.children {
- // ...
- }
- let children = parentNode.children
- for child in children {
- // Do something.
- }
- for case let child as SKSpriteNode in parentNode.children {
- // ...
- }
- let a = Date()
- for case let s as SomeSpriteClass in children { k += 1 }
- let t1 = a.microseconds()
- let b = Date()
- for s in spaceships { k += 1 }
- let t2 = b.microseconds()
- print("(t1) (t2)")
- 939 43
- 140 33
- 127 33
- 117 37
- 109 30
- 126 33
- 127 33
- 109 29
- 96 30
- 96 29
- 99 30
- 97 30
- 97 30
Add Comment
Please, Sign In to add comment