Created
April 10, 2018 17:35
-
-
Save Kdan/7b6968e1c089eee3825321c294b6985a 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
/// The PetFamily enum describes the Pet family of objects. | |
enum PetFamily: String, ClassFamily { | |
case cat = "Cat" | |
case dog = "Dog" | |
static var discriminator: Discriminator = .type | |
func getType() -> AnyObject.Type { | |
switch self { | |
case .cat: | |
return Cat.self | |
case .dog: | |
return Dog.self | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment