ThemeManager
use Category to add theme. And it is super easy to add theme to your app without changing a lot of existed code. You can apply theme to UIButton
and UILabel
and UIImageView
.
Organize theme resources in the following format:
- res/themes/theme.plist
- res/themes/theme1
- res/themes/theme2
- res/themes/theme1/config.plist
- res/themes/theme1/icon@2x.png
- res/themes/theme1/res
- cd Resources
- sh import_theme.sh
cell.textLabel.text = item[@"title"];
// Apply theme text color for textLabel
cell.textLabel.themeMap = @{kThemeMapKeyColorName : @"left_tabbar_cell_title"};
// Apply theme image for imageView
cell.imageView.themeMap = @{kThemeMapKeyImageName : imageName};
ThemeManager is available under the MIT license. See the LICENSE file for more info.