Guest User

Untitled

a guest
Jan 17th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. /// Provides convenience accesors to some info dictionary keys
  2. extension Bundle {
  3. var identifier: String? {
  4. return string(forInfoDictionaryKey: "CFBundleIdentifier")
  5. }
  6.  
  7. var displayName: String? {
  8. return string(forInfoDictionaryKey: "CFBundleDisplayName")
  9. }
  10.  
  11. var shortVersionString: String? {
  12. return string(forInfoDictionaryKey: "CFBundleShortVersionString")
  13. }
  14.  
  15. var version: String? {
  16. return string(forInfoDictionaryKey: "CFBundleVersion")
  17. }
  18.  
  19. func string(forInfoDictionaryKey key: String) -> String? {
  20. return object(forInfoDictionaryKey: key) as? String
  21. }
  22. }
Add Comment
Please, Sign In to add comment