Created
March 19, 2018 08:14
-
-
Save cacheleocode/a6dd782fb851d232284baa22e6ad1dc0 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
if let url = Bundle.main.url(forResource:"Channels", withExtension: "plist") { | |
do { | |
var data = try Data(contentsOf:url) | |
let swiftDictionary = try PropertyListSerialization.propertyList(from: data, options: [], format: nil) as! [String:Any] | |
// do something with the dictionary | |
// debugPrint(swiftDictionary) | |
for (key, values) in swiftDictionary { | |
print(key) | |
} | |
// data.append((swiftDictionary as AnyObject).object("name") as! String) | |
} catch { | |
print(error) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment