CB-8836 - Crashes after animating splashscreen

This commit is contained in:
Shazron Abdullah 2015-04-09 14:07:18 -07:00
parent 35272415d3
commit 559b300d29

View File

@ -289,19 +289,28 @@
} else if (fadeDuration == 0) {
[self destroyViews];
} else {
[UIView transitionWithView:self.viewController.view
duration:fadeDuration
options:UIViewAnimationOptionTransitionNone
animations:^(void) {
[_imageView setAlpha:0];
[_activityView setAlpha:0];
}
completion:^(BOOL finished) {
if (finished) {
[self destroyViews];
}
}
];
__weak __typeof(self) weakSelf = self;
[UIView transitionWithView:self.viewController.view
duration:fadeDuration
options:UIViewAnimationOptionTransitionNone
animations:^(void) {
__typeof(self) strongSelf = weakSelf;
if (strongSelf != nil) {
dispatch_async(dispatch_get_main_queue(), ^{
[strongSelf->_activityView setAlpha:0];
[strongSelf->_imageView setAlpha:0];
});
}
}
completion:^(BOOL finished) {
if (finished) {
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf destroyViews];
});
}
}
];
}
}