Skip to content

Instantly share code, notes, and snippets.

@Winchariot
Last active December 3, 2017 21:31
Show Gist options
  • Save Winchariot/198c4ab32d3a4d3b42a9dcfe46f61666 to your computer and use it in GitHub Desktop.
Save Winchariot/198c4ab32d3a4d3b42a9dcfe46f61666 to your computer and use it in GitHub Desktop.
Load data from a plist
func loadValueFromPlist() {
guard let plistPath: String = Bundle.main.path(forResource: "Info", ofType: "plist"),
let dict = NSDictionary(contentsOfFile: plistPath) else { return }
if let myValue = dict["myKey"] as? String {
//make use of myValue
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment