mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Cache resolved app bundle
This commit is contained in:
parent
820b038bbc
commit
41f05c73d8
@ -1,6 +1,9 @@
|
|||||||
#import <AppBundle/AppBundle.h>
|
#import <AppBundle/AppBundle.h>
|
||||||
|
|
||||||
NSBundle * _Nonnull getAppBundle() {
|
NSBundle * _Nonnull getAppBundle() {
|
||||||
|
static NSBundle *appBundle = nil;
|
||||||
|
static dispatch_once_t onceToken;
|
||||||
|
dispatch_once(&onceToken, ^{
|
||||||
NSBundle *bundle = [NSBundle mainBundle];
|
NSBundle *bundle = [NSBundle mainBundle];
|
||||||
if ([[bundle.bundleURL pathExtension] isEqualToString:@"appex"]) {
|
if ([[bundle.bundleURL pathExtension] isEqualToString:@"appex"]) {
|
||||||
bundle = [NSBundle bundleWithURL:[[bundle.bundleURL URLByDeletingLastPathComponent] URLByDeletingLastPathComponent]];
|
bundle = [NSBundle bundleWithURL:[[bundle.bundleURL URLByDeletingLastPathComponent] URLByDeletingLastPathComponent]];
|
||||||
@ -9,7 +12,10 @@ NSBundle * _Nonnull getAppBundle() {
|
|||||||
} else if ([[bundle.bundleURL pathExtension] isEqualToString:@"Frameworks"]) {
|
} else if ([[bundle.bundleURL pathExtension] isEqualToString:@"Frameworks"]) {
|
||||||
bundle = [NSBundle bundleWithURL:[bundle.bundleURL URLByDeletingLastPathComponent]];
|
bundle = [NSBundle bundleWithURL:[bundle.bundleURL URLByDeletingLastPathComponent]];
|
||||||
}
|
}
|
||||||
return bundle;
|
appBundle = bundle;
|
||||||
|
});
|
||||||
|
|
||||||
|
return appBundle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation UIImage (AppBundle)
|
@implementation UIImage (AppBundle)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user