Created
January 9, 2019 11:47
-
-
Save Maxatma/6618d92b845fc6ec6da909e081d9b357 to your computer and use it in GitHub Desktop.
Swift switch enum problem
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
import UIKit | |
enum DumbTest { | |
case get(user: String) | |
case get(pony: String, tail: String) | |
func getSome() -> String { | |
switch self { | |
case .get(let user): | |
return "User muchacha \(user)" | |
case .get(let pony, let tail): | |
return "Fluttershy \(pony) with \(tail) tail" | |
} | |
} | |
} | |
DumbTest.get(pony: "cute pony", tail: "pink").getSome() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://stackoverflow.com/questions/54109604/how-to-fix-swift-enum-switch-case-problem