Skip to content

Instantly share code, notes, and snippets.

@DisappearPing
Created March 30, 2016 03:56
Show Gist options
  • Save DisappearPing/4ed645667558a999977e4fd67b7e5de0 to your computer and use it in GitHub Desktop.
Save DisappearPing/4ed645667558a999977e4fd67b7e5de0 to your computer and use it in GitHub Desktop.
//產出用zip為key找 縣市/鄉鎮市區
println(zipJson?.dictionaryValue.keys.array)
println(zipJson?.dictionaryValue.values.array)
for var i = 0; i < zipJson?.dictionaryValue.keys.array.count ; i++ {
let first = zipJson?.dictionaryValue.keys.array[i]
let second = zipJson?.dictionaryValue.values.array[i]
let third = zipJson?.dictionaryValue.values.array[i].dictionaryValue
for var j = 0; j < zipJson?.dictionaryValue.values.array[i].dictionaryValue.count ; j++ {
let key = zipJson?.dictionaryValue.values.array[i].dictionaryValue.keys.array[j]
let value = zipJson?.dictionaryValue.values.array[i].dictionaryValue.values.array[j]
println("\(key) : \(value)")
println("\(value) : \(key) - \(first)")
zipToString.updateValue([key!,first!], forKey: value!.stringValue)
}
}
println(zipToString)
let json = JSON(zipToString)
println(json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment