Created
April 13, 2021 03:04
-
-
Save MTACS/28bd74dd51e2c9774082f8e092353825 to your computer and use it in GitHub Desktop.
App icon download progress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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