prevent retain cycle on auto dismiss block.
This commit is contained in:
parent
1196608e25
commit
db778b1d70
@ -347,12 +347,13 @@
|
||||
}
|
||||
dispatch_time_t dispatchTime = dispatch_time(DISPATCH_TIME_NOW, dismissTime * NSEC_PER_SEC);
|
||||
dispatch_after(dispatchTime, dispatch_get_main_queue(), ^(void){
|
||||
if (weakSelf && weakSelf.expanded && weakSelf.collapseAutomaticallyAfterExpanded) {
|
||||
typeof(self) strongSelf = weakSelf;
|
||||
if (strongSelf && strongSelf.expanded && strongSelf.collapseAutomaticallyAfterExpanded) {
|
||||
// If accessibility focused, delay collapse.
|
||||
if ([MVMCoreUIUtility viewContainsAccessiblityFocus:self]) {
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(accessibilityFocusChanged:) name:UIAccessibilityElementFocusedNotification object:nil];
|
||||
if ([MVMCoreUIUtility viewContainsAccessiblityFocus:strongSelf]) {
|
||||
[[NSNotificationCenter defaultCenter] addObserver:strongSelf selector:@selector(accessibilityFocusChanged:) name:UIAccessibilityElementFocusedNotification object:nil];
|
||||
} else {
|
||||
[weakSelf collapse];
|
||||
[strongSelf collapse];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user