Created
September 16, 2015 23:01
-
-
Save endodoug/d0a944754bb01a1b9313 to your computer and use it in GitHub Desktop.
Load plist dictionary in tableview
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
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