Below code snippet is in objective C
__weak MyView *weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.activityIndicatorView stopAnimating];
[weakSelf.activityIndicatorView removeFromSuperview];
weakSelf.activityIndicatorView = nil;
});
- Will the
weakSelf
always available/valid since it is inside the main queue? - Do we need to declare
strongSelf
only when block is other than the main queue?