This library is use for change the color in run time, by the different style file, the system can change the color at runtime.
- Update Project to Swift 4.2
- Fix nil condition
- Remove all the project dependency
- Change UIButton's IBInspectable property name
- Several bug fix
- First release
- Swift 4.2
use_frameworks!
pod 'SAPThemeManager'
- Download and drop
/Classes
folder in your project. - You're done!
It is important to create the style file use the following format and store in json format
Your Style File can be as simple as this:
{
"ColorName1": "HexString",
"ColorName2": "HexString",
...
}
Samply insert the code at didFinishLaunchingWithOptions method
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
SAPThemeManager.initWith(theme: "StyleFileName")
return true
}
Instantiate the View Controller you want to present and use the customPresentViewController method along with your Presentr object to do the custom presentation.
label.backgroundColorKey = "ColorKey1"
button.setTitleColorKey("ColorKey2", for: .normal)
button.setTitleColorKey("ColorKey3", for: .highlighted)
And more...
- iOS 9.0+
- Xcode 8.0+
- Swift 4.0+
Calvin Chang
Presentr is released under the MIT license. See LICENSE for details.