Skip to content

Instantly share code, notes, and snippets.

@vialyx
Created February 28, 2018 11:59
Show Gist options
  • Save vialyx/c32e5e6920ce82b200570ad23af81999 to your computer and use it in GitHub Desktop.
Save vialyx/c32e5e6920ce82b200570ad23af81999 to your computer and use it in GitHub Desktop.
var users: [String: User] = [:]
users["admin"] = user
users["guest"] = User(name: "Antonio Guest")
if users.isEmpty {
print("User dictionary is empty")
} else {
let user = users["admin"]
print("Admin user is: \(String(describing: user))")
// "Admin user is: Optional(__lldb_expr_59.User(name: "Medium Guest"))\n"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment