Skip to content

Instantly share code, notes, and snippets.

@vialyx
Last active March 13, 2018 07:25
Show Gist options
  • Save vialyx/295c8056387a09b68a395ffa54a8fb7b to your computer and use it in GitHub Desktop.
Save vialyx/295c8056387a09b68a395ffa54a8fb7b to your computer and use it in GitHub Desktop.
// TODO: - Use .isEmpty instead of .count
if allUsers.isEmpty {
print("User list is empty")
} else {
let user = allUsers.first
// NOT subscript. Set is unordered collection
// user = allUsers[0]
print("First user is: \(user)")
// "First user is: Optional(__lldb_expr_209.User(id: 654, name: "Chilly Mango"))\n"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment