Check out example codes for "swift dictionary get key from valye". It will help you in understanding the concepts better.

Code Example 1

let dict: [Int: String] = [1: "one", 2: "two", 4: "four"]

if let key = dict.someKey(forValue: "two") { 
    print(key)
} // 2

Learn ReactJs, React Native from akashmittal.com