-
Notifications
You must be signed in to change notification settings - Fork 0
/
bundles.swift
39 lines (33 loc) · 1.32 KB
/
bundles.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#if swift(>=3.0)
protocol InfoDictionaryParseable {
var valueForMainBundle: AnyObject {get}
}
extension CFString : InfoDictionaryParseable {}
extension String: InfoDictionaryParseable {}
extension InfoDictionaryParseable {
var valueForMainBundle: AnyObject {
return Bundle.main().infoDictionary?[self as! String] ?? ""
}
}
#else
protocol InfoDictionaryParseable {
var valueForMainBundle: String {get}
}
extension CFString : InfoDictionaryParseable {}
extension String: InfoDictionaryParseable {}
extension InfoDictionaryParseable {
var valueForMainBundle: String {
return NSBundle.mainBundle().infoDictionary?[self as! String] as? String ?? ""
}
}
#endif
public let BundleSupportedPlatforms = "CFBundleSupportedPlatforms"
public let BundleInfoDictionaryVersion = "CFBundleInfoDictionaryVersion"
public let BundleDevelopmentRegion = "CFBundleDevelopmentRegion"
public let BundleNumericVersion = "CFBundleNumericVersion"
public let BundleIdentifier = "CFBundleIdentifier"
public let BundleShortVersionString = "CFBundleShortVersionString"
public let BundleExecutable = "CFBundleExecutable"
public let BundlePackageType = "CFBundlePackageType"
public let BundleName = "CFBundleName"
public let BundleVersion = "CFBundleVersion"