Showing/Hiding the text while starting/pausing the loading overlay

This commit is contained in:
Sumanth Nadigadda 2023-10-31 22:51:39 +05:30
parent d057559353
commit 9be7fef53c

View File

@ -45,6 +45,7 @@
Label *infoLabel = [Label label]; Label *infoLabel = [Label label];
infoLabel.textAlignment = NSTextAlignmentCenter; infoLabel.textAlignment = NSTextAlignmentCenter;
infoLabel.translatesAutoresizingMaskIntoConstraints = NO; infoLabel.translatesAutoresizingMaskIntoConstraints = NO;
infoLabel.hidden = true;
self.indicatorText = infoLabel; self.indicatorText = infoLabel;
[loadingStack addArrangedSubview:infoLabel]; [loadingStack addArrangedSubview:infoLabel];
@ -84,15 +85,20 @@
if(text != nil){ if(text != nil){
self.indicatorText.attributedText = text; self.indicatorText.attributedText = text;
self.indicatorText.accessibilityLabel = text.string; self.indicatorText.accessibilityLabel = text.string;
self.indicatorText.hidden = false;
} else { } else {
self.indicatorText.attributedText = nil; self.indicatorText.attributedText = nil;
self.indicatorText.accessibilityLabel = @""; self.indicatorText.accessibilityLabel = @"";
self.indicatorText.hidden = true;
} }
[self.activityIndicator resumeSpinner]; [self.activityIndicator resumeSpinner];
} }
- (void)stopLoading { - (void)stopLoading {
[self.activityIndicator pauseSpinner]; [self.activityIndicator pauseSpinner];
self.indicatorText.hidden = true;
self.indicatorText.attributedText = nil;
self.indicatorText.accessibilityLabel = @"";
} }
@end @end