Last active
August 2, 2017 18:07
-
-
Save LucasMW/e24c7d0508b1d91a5307a147967588b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let url = URL(string: "https//api.meusite.org") | |
do { | |
let data = try Data(contentsOf: url!) | |
let json = try JSONSerialization.jsonObject(with: data, options:.allowFragments) | |
let array = json as! [String: Any] | |
for (key,data) in array { | |
let dict = data as! [String : Any] | |
//print(key) | |
//print(data) | |
} | |
//print(json) | |
} | |
catch { | |
print("Couldn't fetch\nError:\(error)") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment