Skip to content

Instantly share code, notes, and snippets.

@endodoug
Created September 16, 2015 23:04
Show Gist options
  • Save endodoug/9d524237e5c98e014863 to your computer and use it in GitHub Desktop.
Save endodoug/9d524237e5c98e014863 to your computer and use it in GitHub Desktop.
Load plist arrary of dictionaries
var data = [String]()
var dataDescription = [String]()
override func viewDidLoad() {
super.viewDidLoad()
if let myPath = NSBundle.mainBundle().pathForResource("data", ofType: "plist") {
if let arrayOfDictionaries = NSArray(contentsOfFile: myPath) {
for dict in arrayOfDictionaries {
data.append(dict.objectForKey("title") as! String)
dataDescription.append(dict.objectForKey("description") as! String)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment