Committed by
GitHub
Merge pull request #1802 from jimmaye/uiactivity-indicator-background-access-bug
#1801: Makes sure UIActivityIndicator view is always initialized on main thread
Showing
1 changed file
with
3 additions
and
3 deletions
@@ -157,10 +157,10 @@ static char TAG_ACTIVITY_SHOW; | @@ -157,10 +157,10 @@ static char TAG_ACTIVITY_SHOW; | ||
157 | - (void)sd_addActivityIndicator { | 157 | - (void)sd_addActivityIndicator { |
158 | #if SD_UIKIT | 158 | #if SD_UIKIT |
159 | if (!self.activityIndicator) { | 159 | if (!self.activityIndicator) { |
160 | - self.activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:[self sd_getIndicatorStyle]]; | ||
161 | - self.activityIndicator.translatesAutoresizingMaskIntoConstraints = NO; | ||
162 | - | ||
163 | dispatch_main_async_safe(^{ | 160 | dispatch_main_async_safe(^{ |
161 | + self.activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:[self sd_getIndicatorStyle]]; | ||
162 | + self.activityIndicator.translatesAutoresizingMaskIntoConstraints = NO; | ||
163 | + | ||
164 | [self addSubview:self.activityIndicator]; | 164 | [self addSubview:self.activityIndicator]; |
165 | 165 | ||
166 | [self addConstraint:[NSLayoutConstraint constraintWithItem:self.activityIndicator | 166 | [self addConstraint:[NSLayoutConstraint constraintWithItem:self.activityIndicator |
-
Please register or login to post a comment