SwiftyThemeKit
自动生成配色方案,一键切换夜间模式。
配色参考自 colorless.app
Shot
使用方法
// 设置主题色和样式
// color: 主题色
// style:light、dark、night
ThemeManager.shared.changeTheme(with: color, style: style)
// bind
navigationController?.navigationBar.tk.barTintColor = \Theme.background.bar
label.tk.textColor = \Theme.text.primary
view.tk.backgroundColor = \Theme.background.primary
// 切换主题, view 会自动更新
ThemeManager.shared.changeTheme(with: anotherColor, style: .night)
安装
carthage
github "octree/SwiftyThemeKit" ~> 1.0.0
CocoaPods
pod 'SwiftyThemeKit', '~> 1.0.0'
许可证
ThemeKit 在 MIT 许可下发布。有关详细信息,请参见 LICENSE 文件。