So apple has had very little documentation I can find for doing this. The big feature I miss from c++ is being able to do something like this (Sorry for any syntax errors I am a little rusty in c++
Int* Chosenint; Int option1 = 1 Int option2 = 2 Int option3 = 3 if (the sun is up) Chosenint = &option1 else Chosenint = &option2 However swift doesnt recognize the "*" or the "&" operator. All I am trying to do is have a global variable that stores a pointer to a SKSpriteNode, and can change to a different one. All swift seems to have is the large UnsafeMutablePointer thing. So how would you do that c++ code in swift but with skspritenodes?
optionxvariables should probably be constants, not variables (or, even better, anenumdeclaration). Consider, perhaps, that whatever it is you're trying to do, you may be trying to do it wrong. see : developer.apple.com/library/prerelease/ios/documentation/Swift/… This advice applies equally to C++inoutparameters stackoverflow.com/q/24004062/327083