Created
December 17, 2017 16:05
-
-
Save kmkrn/c7fed92667e2daa878c5850eb4881eec 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
let owner = DogOwner(name: "Pete", dog: husky) | |
let ownerMirror = Mirror(reflecting: owner) | |
print ("Pete owns a \(ownerMirror.descendant("dog", "breedName") ?? "some dog")") | |
//prints | |
//Pete owns a Husky |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment