123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //
- // XYWebOnRedirectRequestURLProtocol.m
- // Starbuds
- //
- // Created by 翟玉磊 on 2020/5/30.
- // Copyright © 2020 翟玉磊. All rights reserved.
- //
- #import "GetLaunchImage.h"
- @implementation GetLaunchImage
- + (UIImage *)getTheLaunchImage
- {
- CGSize viewSize = [UIScreen mainScreen].bounds.size;
-
- NSString *viewOrientation = nil;
- if (([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortraitUpsideDown) || ([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortrait)) {
- viewOrientation = @"Portrait";
- } else {
- viewOrientation = @"Landscape";
- }
-
- NSString *launchImage = nil;
-
- NSArray* imagesDict = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"UILaunchImages"];
- for (NSDictionary* dict in imagesDict)
- {
- CGSize imageSize = CGSizeFromString(dict[@"UILaunchImageSize"]);
-
- if (CGSizeEqualToSize(imageSize, viewSize) && [viewOrientation isEqualToString:dict[@"UILaunchImageOrientation"]])
- {
- launchImage = dict[@"UILaunchImageName"];
- }
- }
- return [UIImage imageNamed:launchImage];
- }
- @end
|