CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.
TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jun 2015 |
SPMSupports SPM | ✗ |
Maintained by Peter DeWeese.
Get information about your app in Swifty way
Do you remember yourself doing this? Can remember all the keys? How many times have you searched for the right names?
let text = NSBundle.mainBundle().infoDictionary?["CFBundleVersion"]
// Keys
"CFBundleDisplayName", "CFBundleVersion", "UIRequiredDeviceCapabilities", "UIMainStoryboardFile", ...
Wouldn’t it be awesome to have Xcode to show them all? And be staticly typed!?
Enter AppInfo.
AppInfo provides an static typed API for working with infoDictionary
.
let name = AppInfo.CFBundleName
let build = AppInfo.CFBundleVersion
let version = AppInfo.CFBundleShortVersionString
let devices = AppInfo.UIDeviceFamily
/*
Results:
Name - "DemeApp", String
build - 2, Int
version - "1.0", String
devices - ["armv7"], Array
/*
The simplest way - copy AppInfo/Classes/AppInfo.swift
to your project. That’s it!
Please open an issue with bugs and missing features, functionality or ideas for improvements.
Also you can contribute by following this guidelines:
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Kostiantyn Koval, @KostiaKoval
AppInfo is available under the MIT license. See the LICENSE file for more info.