To retrieve the value associated with a key in a map (also known as a dictionary), follow these steps:
main.swift67 chars2 lines
main.swift46 chars2 lines
main.swift106 chars6 lines
Alternatively, you can use optional binding to retrieve the value, like this:
main.swift106 chars6 lines
That's it! Now you know how to retrieve the value associated with a key in a map in Swift.
gistlibby LogSnag