Skip to content

Instantly share code, notes, and snippets.

@jules2689
Created December 27, 2016 05:08
Show Gist options
  • Save jules2689/2523f4723b7c50fc2f4ce45e135717b9 to your computer and use it in GitHub Desktop.
Save jules2689/2523f4723b7c50fc2f4ce45e135717b9 to your computer and use it in GitHub Desktop.
import Foundation
class Secrets {
enum SecretsError: Error {
case NotFound
}
class func secrets() -> Dictionary<String, Any?> {
if let path = Bundle.main.path(forResource: "Secrets", ofType: "plist") {
if let dict = NSDictionary(contentsOfFile: path) as? Dictionary<String, AnyObject> {
return dict
}
}
print("No Secrets file found")
return Dictionary<String, Any?>()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment