Skip to content

Commit

Permalink
优化JSON模式内部机制 , JSON模式自定义Block增加参数
Browse files Browse the repository at this point in the history
  • Loading branch information
李响 committed Jun 13, 2016
1 parent a3a9a6b commit 011131c
Show file tree
Hide file tree
Showing 8 changed files with 184 additions and 138 deletions.
4 changes: 2 additions & 2 deletions LEETheme.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "LEETheme"
s.version = "1.0.3"
s.version = "1.0.4"
s.summary = "最好用的主题管理库"

s.homepage = "https://github.com/lixiang1994/LEETheme"
Expand All @@ -14,7 +14,7 @@ s.author = { "LEE" => "applelixiang@126.com" }
s.platform = :ios
s.platform = :ios, "7.0"

s.source = { :git => "https://github.com/lixiang1994/LEETheme.git", :tag => "1.0.3"}
s.source = { :git => "https://github.com/lixiang1994/LEETheme.git", :tag => "1.0.4"}

s.source_files = "LEEThemeDemo/LEEThemeDemo/LEETheme/**/*.{h,m}"

Expand Down
53 changes: 38 additions & 15 deletions LEEThemeDemo/LEEThemeDemo/LEETheme/LEETheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @author LEE
* @copyright Copyright © 2016年 lee. All rights reserved.
* @version V1.0.3
* @version V1.0.4
*/

#import <Foundation/Foundation.h>
Expand All @@ -22,6 +22,7 @@
@class LEEThemeConfigModel;

typedef void(^LEEThemeConfigBlock)(id item);
typedef void(^LEEThemeConfigBlockToIdentifier)(id item , id value);
typedef LEEThemeConfigModel *(^LEEConfigThemeToFloat)(CGFloat number);
typedef LEEThemeConfigModel *(^LEEConfigThemeToIdentifier)(NSString *identifier);
typedef LEEThemeConfigModel *(^LEEConfigThemeToColor)(NSString *tag , UIColor *color);
Expand All @@ -35,7 +36,8 @@ typedef LEEThemeConfigModel *(^LEEConfigThemeToImageAndState)(NSString *tag , UI
typedef LEEThemeConfigModel *(^LEEConfigThemeToImageAndState)(NSString *tag , UIImage *image , UIControlState state);
typedef LEEThemeConfigModel *(^LEEConfigThemeToKeyPathAndColor)(NSString *tag , NSString *keyPath , UIColor *color);
typedef LEEThemeConfigModel *(^LEEConfigThemeToKeyPathAndImage)(NSString *tag , NSString *keyPath , id image);
typedef LEEThemeConfigModel *(^LEEConfigThemeToKeyPathAndString)(NSString *tag , NSString *keyPath , NSString *string);
typedef LEEThemeConfigModel *(^LEEConfigThemeToIdentifierAndBlock)(NSString *identifier , LEEThemeConfigBlockToIdentifier);

/*
*********************************************************************************
Expand Down Expand Up @@ -131,6 +133,10 @@ typedef LEEThemeConfigModel *(^LEEConfigThemeToKeyPathAndString)(NSString *tag ,
@property (nonatomic , copy , readonly ) LEEConfigThemeToColor LeeAddBackgroundColor;
/** 添加占位符颜色设置 -> 格式: .LeeAddPlaceholderColor(@@"tag" , UIColor) */
@property (nonatomic , copy , readonly ) LEEConfigThemeToColor LeeAddPlaceholderColor;
/** 添加进度轨道渲染颜色设置 -> 格式: .LeeAddTrackTintColor(@@"tag" , UIColor) */
@property (nonatomic , copy , readonly ) LEEConfigThemeToColor LeeAddTrackTintColor;
/** 添加进度渲染颜色设置 -> 格式: .LeeAddProgressTintColor(@@"tag" , UIColor) */
@property (nonatomic , copy , readonly ) LEEConfigThemeToColor LeeAddProgressTintColor;
/** 添加高亮文本颜色设置 -> 格式: .LeeAddHighlightedTextColor(@@"tag" , UIColor) */
@property (nonatomic , copy , readonly ) LEEConfigThemeToColor LeeAddHighlightedTextColor;
/** 添加页数指示渲染颜色设置 -> 格式: .LeeAddPageIndicatorTintColor(@@"tag" , UIColor) */
Expand All @@ -142,41 +148,45 @@ typedef LEEThemeConfigModel *(^LEEConfigThemeToKeyPathAndString)(NSString *tag ,
/** 添加按钮标题阴影颜色设置 -> 格式: .LeeAddButtonTitleShadowColor(@@"tag" , UIColor , UIControlStateNormal) */
@property (nonatomic , copy , readonly ) LEEConfigThemeToColorAndState LeeAddButtonTitleShadowColor;

/** 添加属性颜色设置 -> 格式: .LeeAddKeyPathAndColor(@@"tag" , @"keyPath" , UIColor) */
/** 添加属性颜色设置 -> 格式: .LeeAddKeyPathAndColor(@@"tag" , @@"keyPath" , UIColor) */
@property (nonatomic , copy , readonly ) LEEConfigThemeToKeyPathAndColor LeeAddKeyPathAndColor;

/** Image */

/** 添加图片设置 -> 格式: .LeeAddImage(@@"tag" , UIImage 或 @"imageName" 或 @"imagePath") */
/** 添加图片设置 -> 格式: .LeeAddImage(@@"tag" , UIImage 或 @@"imageName" 或 @@"imagePath") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToImage LeeAddImage;
/** 添加阴影图片设置 -> 格式: .LeeAddShadowImage(@@"tag" , UIImage 或 @"imageName" 或 @"imagePath") */
/** 添加进度轨道图片设置 -> 格式: .LeeAddTrackImage(@@"tag" , UIImage 或 @@"imageName" 或 @@"imagePath") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToImage LeeAddTrackImage;
/** 添加进度图片设置 -> 格式: .LeeAddProgressImage(@@"tag" , UIImage 或 @@"imageName" 或 @@"imagePath") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToImage LeeAddProgressImage;
/** 添加阴影图片设置 -> 格式: .LeeAddShadowImage(@@"tag" , UIImage 或 @@"imageName" 或 @@"imagePath") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToImage LeeAddShadowImage;
/** 添加选中图片设置 -> 格式: .LeeAddSelectedImage(@@"tag" , UIImage 或 @"imageName" 或 @"imagePath") */
/** 添加选中图片设置 -> 格式: .LeeAddSelectedImage(@@"tag" , UIImage 或 @@"imageName" 或 @@"imagePath") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToImage LeeAddSelectedImage;
/** 添加背景图片设置 -> 格式: .LeeAddBackgroundImage(@@"tag" , UIImage 或 @"imageName" 或 @"imagePath") */
/** 添加背景图片设置 -> 格式: .LeeAddBackgroundImage(@@"tag" , UIImage 或 @@"imageName" 或 @@"imagePath") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToImage LeeAddBackgroundImage;
/** 添加返回指示图片设置 -> 格式: .LeeAddBackIndicatorImage(@@"tag" , UIImage 或 @"imageName" 或 @"imagePath") */
/** 添加返回指示图片设置 -> 格式: .LeeAddBackIndicatorImage(@@"tag" , UIImage 或 @@"imageName" 或 @@"imagePath") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToImage LeeAddBackIndicatorImage;
/** 添加返回指示图片设置 -> 格式: .LeeAddBackIndicatorTransitionMaskImage(@@"tag" , UIImage 或 @"imageName" 或 @"imagePath") */
/** 添加返回指示图片设置 -> 格式: .LeeAddBackIndicatorTransitionMaskImage(@@"tag" , UIImage 或 @@"imageName" 或 @@"imagePath") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToImage LeeAddBackIndicatorTransitionMaskImage;
/** 添加选择指示器图片设置 -> 格式: .LeeAddSelectionIndicatorImage(@@"tag" , UIImage 或 @"imageName" 或 @"imagePath") */
/** 添加选择指示器图片设置 -> 格式: .LeeAddSelectionIndicatorImage(@@"tag" , UIImage 或 @@"imageName" 或 @@"imagePath") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToImage LeeAddSelectionIndicatorImage;
/** 添加分栏背景图片设置 -> 格式: .LeeAddScopeBarBackgroundImage(@@"tag" , UIImage 或 @"imageName" 或 @"imagePath") */
/** 添加分栏背景图片设置 -> 格式: .LeeAddScopeBarBackgroundImage(@@"tag" , UIImage 或 @@"imageName" 或 @@"imagePath") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToImage LeeAddScopeBarBackgroundImage;
/** 添加按钮图片设置 -> 格式: .LeeAddButtonImage(@@"tag" , UIImage , UIControlStateNormal) */
@property (nonatomic , copy , readonly ) LEEConfigThemeToImageAndState LeeAddButtonImage;
/** 添加按钮背景图片设置 -> 格式: .LeeAddButtonBackgroundImage(@@"tag" , UIImage , UIControlStateNormal) */
@property (nonatomic , copy , readonly ) LEEConfigThemeToImageAndState LeeAddButtonBackgroundImage;

/** 添加属性图片设置 -> 格式: .LeeAddKeyPathAndImage(@@"tag" , @"keyPath" , UIImage 或 @"imageName" 或 @"imagePath") */
/** 添加属性图片设置 -> 格式: .LeeAddKeyPathAndImage(@@"tag" , @@"keyPath" , UIImage 或 @"imageName" 或 @"imagePath") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToKeyPathAndImage LeeAddKeyPathAndImage;

/** ----JSON设置方式---- */

/** Block */

/** 自定义设置 -> 格式: .LeeCustomConfig(@@"identifier" , ^(id value){ code... }) */
@property (nonatomic , copy , readonly ) LEEConfigThemeToStringAndBlock LeeCustomConfig;
/** 自定义设置 -> 格式: .LeeCustomConfig(@@"identifier" , ^(id item , id value){ code... }) */
@property (nonatomic , copy , readonly ) LEEConfigThemeToIdentifierAndBlock LeeCustomConfig;

/** Color */

Expand Down Expand Up @@ -204,6 +214,10 @@ typedef LEEThemeConfigModel *(^LEEConfigThemeToKeyPathAndString)(NSString *tag ,
@property (nonatomic , copy , readonly ) LEEConfigThemeToIdentifier LeeConfigBackgroundColor;
/** 设置占位符颜色标识符 -> 格式: .LeeConfigPlaceholderColor(@@"identifier") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToIdentifier LeeConfigPlaceholderColor;
/** 设置进度轨道渲染颜色标识符 -> 格式: .LeeConfigTrackTintColor(@@"identifier") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToIdentifier LeeConfigTrackTintColor;
/** 设置进度渲染颜色标识符 -> 格式: .LeeConfigProgressTintColor(@@"identifier") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToIdentifier LeeConfigProgressTintColor;
/** 设置高亮文本颜色标识符 -> 格式: .LeeConfigHighlightedTextColor(@@"identifier") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToIdentifier LeeConfigHighlightedTextColor;
/** 设置页数指示渲染颜色标识符 -> 格式: .LeeConfigPageIndicatorTintColor(@@"identifier") */
Expand All @@ -219,6 +233,10 @@ typedef LEEThemeConfigModel *(^LEEConfigThemeToKeyPathAndString)(NSString *tag ,

/** 设置图片标识符 -> 格式: .LeeConfigImage(@@"identifier") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToIdentifier LeeConfigImage;
/** 设置进度轨道图片标识符 -> 格式: .LeeConfigTrackImage(@@"identifier") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToIdentifier LeeConfigTrackImage;
/** 设置进度图片标识符 -> 格式: .LeeConfigProgressImage(@@"identifier") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToIdentifier LeeConfigProgressImage;
/** 设置阴影图片标识符 -> 格式: .LeeConfigShadowImage(@@"identifier") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToIdentifier LeeConfigShadowImage;
/** 设置选中图片标识符 -> 格式: .LeeConfigSelectedImage(@@"identifier") */
Expand All @@ -238,7 +256,12 @@ typedef LEEThemeConfigModel *(^LEEConfigThemeToKeyPathAndString)(NSString *tag ,
/** 设置按钮背景图片标识符 -> 格式: .LeeConfigButtonBackgroundImage(@@"identifier" , UIControlStateNormal) */
@property (nonatomic , copy , readonly ) LEEConfigThemeToIdentifierAndState LeeConfigButtonBackgroundImage;

/** 设置主题更改过渡动画时长 -> 格式: .LeeChangeThemeAnimationDuration(0.2f) */
/** 设置属性标识符 -> 格式: .LeeAddKeyPathAndColor(@@"keyPath" , @@"identifier") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToString LeeAddKeyPathAndIdentifier;

/** ----通用设置---- */

/** 设置主题更改过渡动画时长 -> 格式: .LeeChangeThemeAnimationDuration(0.1f) */
@property (nonatomic , copy , readonly ) LEEConfigThemeToFloat LeeChangeThemeAnimationDuration;

@end
Expand Down
Loading

0 comments on commit 011131c

Please sign in to comment.