AppDelegate.m 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // AppDelegate.m
  3. // 唔即云相册
  4. //
  5. // Created by 余衡武 on 2021/12/8.
  6. //
  7. #import "AppDelegate.h"
  8. @interface AppDelegate ()
  9. @end
  10. @implementation AppDelegate
  11. + (AppDelegate*)sharedAppDelegate
  12. {
  13. static AppDelegate *appDelegate = nil;
  14. static dispatch_once_t onceToken;
  15. dispatch_once(&onceToken, ^{
  16. if (appDelegate == nil) {
  17. appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
  18. }
  19. });
  20. return appDelegate;
  21. }
  22. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  23. //设置默认值
  24. self.couldPhone_W_PHONE = 720.0;
  25. self.couldPhone_H_PHONE = 1280.0;
  26. [[UIButton appearance] setExclusiveTouch:YES];
  27. return YES;
  28. }
  29. /// 在这里写支持的旋转方向,为了防止横屏方向,应用启动时候界面变为横屏模式
  30. - (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
  31. return UIInterfaceOrientationMaskPortrait;
  32. }
  33. #pragma mark - UISceneSession lifecycle
  34. - (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options {
  35. // Called when a new scene session is being created.
  36. // Use this method to select a configuration to create the new scene with.
  37. return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role];
  38. }
  39. - (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *)sceneSessions {
  40. // Called when the user discards a scene session.
  41. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
  42. // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
  43. }
  44. @end