#1801: Makes sure UIActivityIndicator view is always initialized on the main thread
This commit is contained in:
parent
42a5e6f6ec
commit
e132300a0f
|
@ -173,10 +173,10 @@ static char TAG_ACTIVITY_SHOW;
|
||||||
|
|
||||||
- (void)addActivityIndicator {
|
- (void)addActivityIndicator {
|
||||||
if (!self.activityIndicator) {
|
if (!self.activityIndicator) {
|
||||||
|
dispatch_main_async_safe(^{
|
||||||
self.activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:[self getIndicatorStyle]];
|
self.activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:[self getIndicatorStyle]];
|
||||||
self.activityIndicator.translatesAutoresizingMaskIntoConstraints = NO;
|
self.activityIndicator.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
|
|
||||||
dispatch_main_async_safe(^{
|
|
||||||
[self addSubview:self.activityIndicator];
|
[self addSubview:self.activityIndicator];
|
||||||
|
|
||||||
[self addConstraint:[NSLayoutConstraint constraintWithItem:self.activityIndicator
|
[self addConstraint:[NSLayoutConstraint constraintWithItem:self.activityIndicator
|
||||||
|
|
Loading…
Reference in New Issue