Skip to content

Commit

Permalink
发布1.1.6
Browse files Browse the repository at this point in the history
- 优化清空标识符设置
- 优化移除某一标识符设置
- 优化标识符模式的Selector设置方法 并且参数支持多个标识符 (原来设置一个Selector 参数只能设置一个标识符)
- 增加LEEThemeHelper.h文件 优化文件结构
- 其他小细节完善
  • Loading branch information
lixiang1994 committed Aug 16, 2017
1 parent 9a828b0 commit b759b35
Show file tree
Hide file tree
Showing 9 changed files with 329 additions and 176 deletions.
2 changes: 1 addition & 1 deletion Framework/LEETheme/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.5</string>
<string>1.1.6</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
4 changes: 4 additions & 0 deletions Framework/LEETheme/LEETheme.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
9B1081341F442F8600D3A7E2 /* LEEThemeHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B1081331F442F8600D3A7E2 /* LEEThemeHelper.h */; };
9B9712C41EC4296E00C1CB79 /* LEETheme.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B9712C21EC4296E00C1CB79 /* LEETheme.h */; settings = {ATTRIBUTES = (Public, ); }; };
9B9712C51EC4296E00C1CB79 /* LEETheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B9712C31EC4296E00C1CB79 /* LEETheme.m */; };
9B9712CD1EC433A700C1CB79 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B9712CC1EC433A700C1CB79 /* CoreGraphics.framework */; };
Expand All @@ -15,6 +16,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
9B1081331F442F8600D3A7E2 /* LEEThemeHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LEEThemeHelper.h; sourceTree = "<group>"; };
9B9712AB1EC427D200C1CB79 /* LEETheme.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LEETheme.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9B9712BF1EC4294300C1CB79 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9B9712C21EC4296E00C1CB79 /* LEETheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LEETheme.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -61,6 +63,7 @@
children = (
9B9712C21EC4296E00C1CB79 /* LEETheme.h */,
9B9712C31EC4296E00C1CB79 /* LEETheme.m */,
9B1081331F442F8600D3A7E2 /* LEEThemeHelper.h */,
);
name = LEETheme;
path = ../../LEETheme;
Expand Down Expand Up @@ -92,6 +95,7 @@
buildActionMask = 2147483647;
files = (
9B9712C41EC4296E00C1CB79 /* LEETheme.h in Headers */,
9B1081341F442F8600D3A7E2 /* LEEThemeHelper.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
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.1.5"
s.version = "1.1.6"
s.summary = "最好用的轻量级主题管理库"

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

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

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

Expand Down
71 changes: 15 additions & 56 deletions LEETheme/LEETheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,13 @@
*
* @author LEE
* @copyright Copyright © 2016 - 2017年 lee. All rights reserved.
* @version V1.1.5
* @version V1.1.6
*/

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

FOUNDATION_EXPORT double LEEThemeVersionNumber;
FOUNDATION_EXPORT const unsigned char LEEThemeVersionString[];

@class LEEThemeConfigModel;

typedef void(^LEEThemeConfigBlock)(id item);
typedef void(^LEEThemeConfigBlockToValue)(id item , id value);
typedef void(^LEEThemeChangingBlock)(NSString *tag , id item);
typedef LEEThemeConfigModel *(^LEEConfigTheme)();
typedef LEEThemeConfigModel *(^LEEConfigThemeToFloat)(CGFloat number);
typedef LEEThemeConfigModel *(^LEEConfigThemeToTag)(NSString *tag);
typedef LEEThemeConfigModel *(^LEEConfigThemeToKeyPath)(NSString *keyPath);
typedef LEEThemeConfigModel *(^LEEConfigThemeToSelector)(SEL selector);
typedef LEEThemeConfigModel *(^LEEConfigThemeToIdentifier)(NSString *identifier);
typedef LEEThemeConfigModel *(^LEEConfigThemeToChangingBlock)(LEEThemeChangingBlock);
typedef LEEThemeConfigModel *(^LEEConfigThemeToT_KeyPath)(NSString *tag , NSString *keyPath);
typedef LEEThemeConfigModel *(^LEEConfigThemeToT_Selector)(NSString *tag , SEL selector);
typedef LEEThemeConfigModel *(^LEEConfigThemeToT_Color)(NSString *tag , id color);
typedef LEEThemeConfigModel *(^LEEConfigThemeToT_Image)(NSString *tag , id image);
typedef LEEThemeConfigModel *(^LEEConfigThemeToT_Block)(NSString *tag , LEEThemeConfigBlock);
typedef LEEThemeConfigModel *(^LEEConfigThemeToTs_Block)(NSArray *tags , LEEThemeConfigBlock);
typedef LEEThemeConfigModel *(^LEEConfigThemeToKeyPathAndIdentifier)(NSString *keyPath , NSString *identifier);
typedef LEEThemeConfigModel *(^LEEConfigThemeToSelectorAndIdentifier)(SEL sel , NSString *identifier);
typedef LEEThemeConfigModel *(^LEEConfigThemeToSelectorAndIdentifierAndValueIndexAndValueArray)(SEL sel , NSString *identifier , NSInteger valueIndex , NSArray *otherValues);
typedef LEEThemeConfigModel *(^LEEConfigThemeToIdentifierAndState)(NSString *identifier , UIControlState state);
typedef LEEThemeConfigModel *(^LEEConfigThemeToT_ColorAndState)(NSString *tag , UIColor *color , UIControlState state);
typedef LEEThemeConfigModel *(^LEEConfigThemeToT_ImageAndState)(NSString *tag , UIImage *image , UIControlState state);
typedef LEEThemeConfigModel *(^LEEConfigThemeToT_KeyPathAndValue)(NSString *tag , NSString *keyPath , id value);
typedef LEEThemeConfigModel *(^LEEConfigThemeToT_SelectorAndColor)(NSString *tag , SEL sel , id color);
typedef LEEThemeConfigModel *(^LEEConfigThemeToT_SelectorAndImage)(NSString *tag , SEL sel , id image);
typedef LEEThemeConfigModel *(^LEEConfigThemeToT_SelectorAndValues)(NSString *tag , SEL sel , ...);
typedef LEEThemeConfigModel *(^LEEConfigThemeToT_SelectorAndValueArray)(NSString *tag , SEL sel , NSArray *values);
typedef LEEThemeConfigModel *(^LEEConfigThemeToIdentifierAndBlock)(NSString *identifier , LEEThemeConfigBlockToValue);
#import "LEEThemeHelper.h"

/*
Expand Down Expand Up @@ -405,8 +373,8 @@ typedef LEEThemeConfigModel *(^LEEConfigThemeToIdentifierAndBlock)(NSString *ide
/** 设置方法标识符 -> 格式: .LeeConfigSelectorAndIdentifier(@@selector(XXX:) , @@"identifier") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToSelectorAndIdentifier LeeConfigSelectorAndIdentifier;

/** 设置方法标识符 -> 格式: .LeeConfigSelectorAndIdentifierAndValueIndexAndValueArray(@@selector(XXX:XXX:) , @@"identifier" , 0 , @@[id , id]) */
@property (nonatomic , copy , readonly ) LEEConfigThemeToSelectorAndIdentifierAndValueIndexAndValueArray LeeConfigSelectorAndIdentifierAndValueIndexAndValueArray;
/** 设置方法标识符 -> 格式: .LeeConfigSelectorAndValueArray(@@selector(XXX:XXX:) , @@[id , id]) */
@property (nonatomic , copy , readonly ) LEEConfigThemeToSelectorAndValues LeeConfigSelectorAndValueArray;

/** 移除路径标识符设置 -> 格式: .LeeRemoveKeyPathIdentifier(@@"keyPath") */
@property (nonatomic , copy , readonly ) LEEConfigThemeToKeyPath LeeRemoveKeyPathIdentifier;
Expand All @@ -423,13 +391,23 @@ typedef LEEThemeConfigModel *(^LEEConfigThemeToIdentifierAndBlock)(NSString *ide

@end

@interface LEEThemeIdentifier : NSString

+ (LEEThemeIdentifier *)ident:(NSString *)ident;

@end

@interface NSObject (LEEThemeConfigObject)

@property (nonatomic , strong ) LEEThemeConfigModel *lee_theme;

@end

@interface UIColor (LEEThemeColor)

+ (UIColor *)leeTheme_ColorWithHexString:(NSString *)hexString;

@end


/*
Expand All @@ -454,25 +432,6 @@ typedef LEEThemeConfigModel *(^LEEConfigThemeToIdentifierAndBlock)(NSString *ide
* └─┐ ┐ ┌───────┬──┐ ┌──┘
* │ ─┤ ─┤ │ ─┤ ─┤
* └──┴──┘ └──┴──┘
* 神兽保佑
* 神兽 保佑
* 代码无BUG!
*/


@interface UIColor (LEEThemeColor)

+ (UIColor *)leeTheme_ColorWithHexString:(NSString *)hexString;

@end

#define LEEColorRGBA(R , G , B , A) [UIColor colorWithRed:R/255.0f green:G/255.0f blue:B/255.0f alpha:A]

#define LEEColorRGB(R , G , B) LEEColorRGBA(R , G , B , 1.0f)

#define LEEColorHex(hex) [UIColor leeTheme_ColorWithHexString:hex]

#define LEEColorFromIdentifier(tag, identifier) ({((UIColor *)([LEETheme getValueWithTag:tag Identifier:identifier]));})

#define LEEImageFromIdentifier(tag, identifier) ({((UIImage *)([LEETheme getValueWithTag:tag Identifier:identifier]));})

#define LEEValueFromIdentifier(tag, identifier) ({([LEETheme getValueWithTag:tag Identifier:identifier]);})
Loading

0 comments on commit b759b35

Please sign in to comment.