LoginSignup
4
4

More than 5 years have passed since last update.

SwiftyにInfoPlistの値を取得する

Last updated at Posted at 2016-05-18

いろいろ溜まってきたので小出しにしていこうと思います。

private let _Plist = NSBundle.mainBundle().infoDictionary!
class _InfoPlist {
    subscript(key: InfoPlistKey) -> String {
        return _Plist["\(key)"] as! String
    }
}
let InfoPlist = _InfoPlist()

enum InfoPlistKey: String {
    case GroupStorageIdentifier
    case AppPageUrl
    case LogLevel
}

let groupStorageIdentifier = InfoPlist[.GroupStorageIdentifier]

確かSwiftyUserDefaultsとか参考にしたと思う。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4