Last active
February 21, 2018 21:05
-
-
Save vrutberg/b8593a8f3ea01159326298be5996f824 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
struct Pet { | |
let name: String | |
} | |
struct Person { | |
let name: String | |
let pets: [Pet] | |
} | |
// a conditional unwrap - people is an array of Person objects | |
let petName = people.first?.pets.first?.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment