Skip to content

Commit

Permalink
为 SwitchOffTintColor 的使用加上配置表是否开启的判断
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLice committed Dec 11, 2019
1 parent 9f9f6b4 commit f9f872e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions QMUIKit/UIKitExtensions/UISwitch+QMUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ + (void)load {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
ExtendImplementationOfNonVoidMethodWithSingleArgument([UISwitch class], @selector(initWithFrame:), CGRect, UISwitch *, ^UISwitch *(UISwitch *selfObject, CGRect firstArgv, UISwitch *originReturnValue) {
if (QMUICMIActivated && SwitchTintColor) {
selfObject.tintColor = SwitchTintColor;
selfObject.qmui_offTintColor = SwitchOffTintColor;
if (QMUICMIActivated) {
if (SwitchTintColor) {
selfObject.tintColor = SwitchTintColor;
}
if (SwitchOffTintColor) {
selfObject.qmui_offTintColor = SwitchOffTintColor;
}
}
return originReturnValue;
});
Expand Down

0 comments on commit f9f872e

Please sign in to comment.