Check out example codes for "loop key value swift". It will help you in understanding the concepts better.

Code Example 1

func findDic(dict: [String: String]){
    for (key, value) in dict{
    print("\(key) : \(value)")
  }
}

findDic(dict: ["Animal":"Lion", "Bird":"Sparrow"])
//prints Animal : Lion 
         Bird : Sparrow

Learn ReactJs, React Native from akashmittal.com