Skip to content

Commit

Permalink
修复Button圆角失效问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lixiang1994 committed Apr 24, 2020
1 parent 4a48a12 commit 9c7e427
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Framework/LEEAlert/LEEAlert.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.3.6;
MARKETING_VERSION = 1.3.7;
PRODUCT_BUNDLE_IDENTIFIER = com.lee.LEEAlert;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -325,7 +325,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.3.6;
MARKETING_VERSION = 1.3.7;
PRODUCT_BUNDLE_IDENTIFIER = com.lee.LEEAlert;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down
2 changes: 1 addition & 1 deletion LEEAlert.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "LEEAlert"
s.version = "1.3.6"
s.version = "1.3.7"
s.summary = "优雅的Alert ActionSheet"

s.homepage = "https://github.com/lixiang1994/LEEAlert"
Expand Down
2 changes: 1 addition & 1 deletion LEEAlert/LEEAlert.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @author LEE
* @copyright Copyright © 2016 - 2019年 lee. All rights reserved.
* @version V1.3.6
* @version V1.3.7
*/

#import <Foundation/Foundation.h>
Expand Down
49 changes: 48 additions & 1 deletion LEEAlert/LEEAlert.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @author LEE
* @copyright Copyright © 2016 - 2019年 lee. All rights reserved.
* @version V1.3.6
* @version V1.3.7
*/

#import "LEEAlert.h"
Expand Down Expand Up @@ -1310,6 +1310,53 @@ - (void)setLee_alert_cornerRadii:(CornerRadii)cornerRadii{

@end

@interface UIButton (LEEAlertExtension)

@end

@implementation UIButton (LEEAlertExtension)

+ (void)load{

static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{

NSArray *selStringsArray = @[@"layoutSubviews"];

[selStringsArray enumerateObjectsUsingBlock:^(NSString *selString, NSUInteger idx, BOOL *stop) {

NSString *leeSelString = [@"lee_alert_" stringByAppendingString:selString];

Method originalMethod = class_getInstanceMethod(self, NSSelectorFromString(selString));

Method leeMethod = class_getInstanceMethod(self, NSSelectorFromString(leeSelString));

BOOL isAddedMethod = class_addMethod(self, NSSelectorFromString(selString), method_getImplementation(leeMethod), method_getTypeEncoding(leeMethod));

if (isAddedMethod) {

class_replaceMethod(self, NSSelectorFromString(leeSelString), method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod));

} else {

method_exchangeImplementations(originalMethod, leeMethod);
}

}];

});

}

- (void)lee_alert_layoutSubviews{

[self lee_alert_layoutSubviews];

[self lee_alert_updateCornerRadii];
}

@end

@implementation LEEAlertWindow

@end
Expand Down
2 changes: 1 addition & 1 deletion LEEAlert/LEEAlertHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @author LEE
* @copyright Copyright © 2016 - 2019年 lee. All rights reserved.
* @version V1.3.6
* @version V1.3.7
*/

#ifndef LEEAlertHelper_h
Expand Down
4 changes: 4 additions & 0 deletions UPDATELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

# LEEAlert - 更新日志

V1.3.7
==============
修复Button圆角失效问题

V1.3.6
==============
修复iOS10以下崩溃问题
Expand Down

0 comments on commit 9c7e427

Please sign in to comment.