Last active
August 29, 2015 14:02
-
-
Save veeneck/5eafa5e3170b65b326c5 to your computer and use it in GitHub Desktop.
Swift Casting in Callback Parameter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // How do you cast SKNode to Flag : SKNode in parameter definition? | |
| scene.enumerateChildNodesWithName("flag") { | |
| node as Flag, stop in | |
| node.methodAvailableToFlagObject() | |
| } | |
| // I'm trying to avoid having to do this: | |
| scene.enumerateChildNodesWithName("flag") { | |
| node, stop in | |
| let realNode = node as Flag | |
| realNode.methodAvailableToFlagObject() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment