BWSnippet

Swift Dictionary keys as array

Swift Dictionary keys as array

get the keys from a dictionary as an array using swift


        let dic:Dictionary<String,Array<String>> = [ "hats":["hat_1"], "mustaches":["mustache-1"] , "noses":["noses-1","HI!"] ]
        let theKeys = Array(dic.keys)

Tags

Swift Dictionary keys as array