Skip to content

Instantly share code, notes, and snippets.

@MTACS
Created April 13, 2021 03:04
Show Gist options
  • Save MTACS/28bd74dd51e2c9774082f8e092353825 to your computer and use it in GitHub Desktop.
Save MTACS/28bd74dd51e2c9774082f8e092353825 to your computer and use it in GitHub Desktop.
App icon download progress
@interface SBIcon : NSObject
@end
@interface SBLeafIcon : SBIcon
- (id)displayNameForLocation:(id)arg1;
@end
@interface SBIconView: UIView
@property (nonatomic, retain) SBIcon *icon;
- (void)_updateLabel;
@end
%hook SBLeafIcon
- (id)displayNameForLocation:(id)arg1 {
if (self.isDownloadingIcon == YES) {
return [NSString stringWithFormat:@"%.0f%%", self.progressPercent * 100];
}
return %orig;
}
%end
%hook SBIconView
- (void)_updateProgressAnimated:(BOOL)arg1 {
%orig;
if (self.icon.isDownloadingIcon == YES) {
[self _updateLabel];
}
}
%end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment