Skip to content

Instantly share code, notes, and snippets.

@endodoug
Created September 16, 2015 23:01
Show Gist options
  • Save endodoug/d0a944754bb01a1b9313 to your computer and use it in GitHub Desktop.
Save endodoug/d0a944754bb01a1b9313 to your computer and use it in GitHub Desktop.
Load plist dictionary in tableview
var tableData = [String]()
override func viewDidLoad() {
super.viewDidLoad()
var dict: NSDictionary?
if let path = NSBundle.mainBundle().pathForResource("TableData", ofType: "plist") {
dict = NSDictionary(contentsOfFile: path)
}
if let myDict = dict {
print(myDict)
tableData = myDict.objectForKey("AppleDevices") as! [String]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment