Skip to content

yanjunz/ThemeManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ThemeManager

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.

Preparation

Organize theme resources in the following format:

A summary file to include all themes

  • res/themes/theme.plist

Theme directory

  • res/themes/theme1
  • res/themes/theme2

Theme Description file and icon file

  • res/themes/theme1/config.plist
  • res/themes/theme1/icon@2x.png

Theme resources

  • res/themes/theme1/res

Create config.plist for theme with script

  • cd Resources
  • sh import_theme.sh

Usage

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};

License

ThemeManager is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published