Skip to content

Commit 231ac35

Browse files
committed
Add UISwitch to whitelist for iOS 10
1 parent 6ff31f8 commit 231ac35

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

MLeaksFinder/NSObject+MemoryLeak.m

+8-2
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,21 @@ - (void)setParentPtrs:(NSSet *)parentPtrs {
108108
}
109109

110110
+ (NSSet *)classNamesInWhiteList {
111-
static NSSet *whiteList;
111+
static NSMutableSet *whiteList;
112112
static dispatch_once_t onceToken;
113113
dispatch_once(&onceToken, ^{
114-
whiteList = [NSSet setWithObjects:
114+
whiteList = [NSMutableSet setWithObjects:
115115
@"UIFieldEditor", // UIAlertControllerTextField
116116
@"UINavigationBar",
117117
@"_UIAlertControllerActionView",
118118
@"_UIVisualEffectBackdropView",
119119
nil];
120+
121+
// System's bug since iOS 10 and not fixed yet up to this ci.
122+
NSString *systemVersion = [UIDevice currentDevice].systemVersion;
123+
if ([systemVersion compare:@"10.0" options:NSNumericSearch] != NSOrderedAscending) {
124+
[whiteList addObject:@"UISwitch"];
125+
}
120126
});
121127
return whiteList;
122128
}

0 commit comments

Comments
 (0)