Created
November 1, 2017 21:29
-
-
Save jkinkead/26bf3b3d071b3277fb61eb8ff4be8829 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 UserLogin { | |
password: String, | |
username: String, | |
} | |
let loginInfo: UserLogin = getLoginFromEnvironment(); | |
// These variable names must match the struct names for the short syntax. | |
let UserLogin { username, password } = loginInfo; | |
// You can rebind explicitly, if you want new names. | |
let UserLogin { username: myUsername, password: myPassword } = loginInfo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment