Created
June 20, 2018 19:51
-
-
Save richy486/c4a2b44e5ffbe287ea16a5ee162d7a69 to your computer and use it in GitHub Desktop.
This file contains 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
// Is this a good shorthand instead of using a switch? | |
enum State { | |
case running | |
case jumping | |
} | |
var currentState: State = .running | |
let stateView = currentState.transform {[ | |
.running: RunningView(), | |
.jumping: JumpingView() | |
]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment