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