Skip to content

Instantly share code, notes, and snippets.

@qdequele
Created February 9, 2017 09:26
Show Gist options
  • Save qdequele/1b5e57657185fa2ddd4cd2a6174417e9 to your computer and use it in GitHub Desktop.
Save qdequele/1b5e57657185fa2ddd4cd2a6174417e9 to your computer and use it in GitHub Desktop.
//
// PlistHelper.swift
// Crisp-ios
//
// Created by Quentin DEQUELEN on 12/3/16.
// Copyright © 2016 qdequele. All rights reserved.
//
import Foundation
class Plist {
class func get(name: String) -> String {
var myDict: NSDictionary?
if let path = Bundle.main.path(forResource: "Config", ofType: "plist") {
myDict = NSDictionary(contentsOfFile: path)
}
if let dict = myDict {
return dict.object(forKey: name) as! String
}
return ""
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment