Skip to content

Instantly share code, notes, and snippets.

@vialyx
Last active March 13, 2018 07:19
Show Gist options
  • Save vialyx/ddf324fd3281aec026b85e221a83d87d to your computer and use it in GitHub Desktop.
Save vialyx/ddf324fd3281aec026b85e221a83d87d to your computer and use it in GitHub Desktop.
let admins = [User(name: "Admin")]
// [{name "Admin"}]
let guests = [User(name: "Guest")]
// [{name "Guest"}]
var allUsers = admins + guests
// [{name "Admin"}, {name "Guest"}]
// TODO: - Iterate over the entire collection with the for-in loop:
for user in allUsers {
print("User: \(user)")
/*
User: User(name: "Admin")
User: User(name: "Guest")
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment