Screen with application info (naming, version, API environment etc).
- Manual/Automatic dev info screen opening
- Display Application info
- Display environment info (from info.plist, key - Key_type)
- Display info from Key-(environment).plist
- Show contents of User Defaults
- Display info about Facebook App
- Display info from GoogleService-Info.plist file
- Developer can limit sections to show
- Developer can add own properties (type: String)
- Dynamically watch added property (type: String)
- Display info from any .plist file (Data types: String, Number, Bool, Date)
- Show any particular key from any .plist file (Data types: String, Number, Bool, Date)
- Display info by key from User Defaults
- You can easily copy value by tapping on cell
- iOS 8.0+
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapodsTo integrate GBKDevInfoMode into your Xcode project using CocoaPods, specify it in your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target '<Your Target Name>' do
pod 'GBKDevInfoMode'
endThen, run the following command:
$ pod installAttention: you need to setup GBKDevInfoMode first, before interacting with it.
Import framework:
import GBKDevInfoModeTo start using simply:
GBKDevInfoMode.shared.setup(isEnabled: true)Don't forget to set isEnabled to false.
To limit sections to show:
GBKDevInfoMode.shared.setup(isEnabled: true, sections: [.appInfo, .keyAPI, .userDefaults, .googleList, .custom])Sections types:
public enum SectionType {
case appInfo /// base app info: (app name, bundle, app version, app build, OS)
case keyAPI /// key api (environment from info.plist, all values from Key_\(environment).plist)
case userDefaults /// all user defaults
case facebookList /// Facebook info from info.plist
case googleList /// GoogleService-Info.plist
case custom /// custom property list
}To disable opening dev info screen by shaking:
GBKDevInfoMode.shared.automaticLaunchByShake = falseTo manually show screen:
GBKDevInfoMode.shared.manualLaunch()To show custom information you have 5 possibilities:
To add custom info you need specify .custom during setup
// Values
let valueUserName = GBKDIMDevValueModel(title: "User name", value: "username")
let valueToken = GBKDIMDevValueModel(title: "Token", value: "1234567890zxcvbnm")
// Section
let section = GBKDIMDevSectionModel(title: "Custom section", items: [valueUserName, valueToken])
// Add section to GBK Dev Info Mode
GBKDevInfoMode.shared.add(section: section)// Values
let valueUserName = GBKDIMDevValueModel(title: "User name", value: "username", uniqueKey: "username")
let valueToken = GBKDIMDevValueModel(title: "Token", value: "1234567890zxcvbnm", uniqueKey: "token")
// Section
let section = GBKDIMDevSectionModel(title: "Custom section", items: [valueUserName, valueToken])
// Add section to GBK Dev Info Mode
GBKDevInfoMode.shared.add(section: section)
///
...
///
GBKDevInfoMode.shared.update(value: "newtoken", in: "token")// Values
let valueFromKey1 = GBKDIMDevValuePlistModel(title: "Test value 1", name: "<key_name>", inFile: "<filename>")
let valueFromKey2 = GBKDIMDevValuePlistModel(title: "Test value 2", name: "<key_name>", inFile: "<filename>")
// Section
let section = GBKDIMDevSectionModel(title: "Custom section key from plist", items: [valueFromKey1, valueFromKey2])
// Add section to GBK Dev Info Mode
GBKDevInfoMode.shared.add(section: section)// Section
let section = GBKDIMDevSectionPlistModel(title: "Custom section from plist", fromFile: "<filename>")
// Add section to GBK Dev Info Mode
GBKDevInfoMode.shared.add(section: section)// Section
let section = GBKDIMDevSectionUserDefaultsModel(title: "Custom section from custom User Defaults", suiteName: "<filename>")
// Add section to GBK Dev Info Mode
GBKDevInfoMode.shared.add(section: section)// Values
let valueFromKey1 = GBKDIMDevValueUserDefaultsModel(title: "Test value 1", key: "<key_name_from_user_defaults>")
let valueFromKey2 = GBKDIMDevValueUserDefaultsModel(title: "Test value 2", key: "<key_name_from_user_defaults>", suiteName: "<name_user_defaults>")
// Section
let section = GBKDIMDevSectionModel(title: "Custom section key from user defaults", items: [valueFromKey1, valueFromKey2])
// Add section to GBK Dev Info Mode
GBKDevInfoMode.shared.add(section: section)- Add properties (on other screen) which could be changed in runtime (eg user auth token).
If UIWindow has extension on and overrides method motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?), you need manually open dev info window (automaticLaunchByShake wont work)
extension UIWindow {
open override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
// ...
if motion == .motionShake {
GBKDevInfoMode.shared.motionShake()
}
}
}We'd be very happy if you sent links to your projects where you use our component. Just send us email to github@gbksoft.com
