From f37be18fa5c4b22ebb567e7b5c7d9853f74a5e83 Mon Sep 17 00:00:00 2001 From: Nicholas Entin Date: Wed, 25 Oct 2023 19:19:10 -0700 Subject: [PATCH 1/2] Bump deployment targets to iOS 14, watchOS 7, Xcode 14 --- .github/workflows/ci.yml | 8 +--- Aardvark.podspec | 6 +-- Aardvark.xcodeproj/project.pbxproj | 42 +++++++++---------- .../xcshareddata/xcschemes/Aardvark.xcscheme | 2 +- .../xcschemes/AardvarkLoggingUI.xcscheme | 2 +- .../xcschemes/All Frameworks.xcscheme | 2 +- .../xcschemes/CoreAardvark.xcscheme | 2 +- AardvarkLoggingUI.podspec | 6 +-- AardvarkMailUI.podspec | 4 +- .../AardvarkSample.xcodeproj/project.pbxproj | 28 +++++++++---- .../xcschemes/AardvarkSample.xcscheme | 2 +- CoreAardvark.podspec | 6 +-- README.md | 6 +-- .../Aardvark/UIApplication+ARKAdditions.swift | 4 ++ Sources/AardvarkMailUI/ARKEmailBugReporter.h | 1 + Sources/AardvarkMailUI/ARKEmailBugReporter.m | 42 +++++++++++++------ 16 files changed, 96 insertions(+), 67 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63c41c4b..1bed02e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,15 +15,13 @@ jobs: uses: actions/checkout@v2 - name: Bundle Install run: bundle install - - name: Select Xcode Version - run: sudo xcode-select --switch /Applications/Xcode_13.1.app/Contents/Developer - name: Build and Test Frameworks run: | xcodebuild \ -project Aardvark.xcodeproj \ -scheme "All Frameworks" \ -sdk iphonesimulator \ - -destination "platform=iOS Simulator,name=iPhone 13 Pro" \ + -destination "platform=iOS Simulator,name=iPhone 14 Pro" \ test - name: Build Sample App run: | @@ -37,14 +35,12 @@ jobs: build pod-lint: name: Pod Lint - runs-on: macOS-11 + runs-on: macOS-12 steps: - name: Checkout Repo uses: actions/checkout@v2 - name: Bundle Install run: bundle install - - name: Select Xcode Version - run: sudo xcode-select --switch /Applications/Xcode_13.1.app/Contents/Developer - name: Lint CoreAardvark Podspec run: bundle exec pod lib lint --verbose --fail-fast CoreAardvark.podspec - name: Lint Aardvark Podspec diff --git a/Aardvark.podspec b/Aardvark.podspec index 1236df49..5e523b8f 100644 --- a/Aardvark.podspec +++ b/Aardvark.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Aardvark' - s.version = '4.1.0' + s.version = '5.0.0' s.license = 'Apache License, Version 2.0' s.summary = 'Aardvark is a library that makes it dead simple to create actionable bug reports.' s.homepage = 'https://github.com/square/Aardvark' @@ -8,10 +8,10 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/square/Aardvark.git', :tag => "Aardvark/#{ s.version.to_s }" } s.swift_version = '5.0' - s.ios.deployment_target = '12.0' + s.ios.deployment_target = '14.0' s.source_files = 'Sources/Aardvark/**/*.{h,m,swift}' s.resource_bundle = {'Aardvark' => ['Sources/Aardvark/PrivacyInfo.xcprivacy']} - s.dependency 'CoreAardvark', '~> 3.0' + s.dependency 'CoreAardvark', '~> 4.0' end diff --git a/Aardvark.xcodeproj/project.pbxproj b/Aardvark.xcodeproj/project.pbxproj index 2bf25e48..3a340ffe 100644 --- a/Aardvark.xcodeproj/project.pbxproj +++ b/Aardvark.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -1082,7 +1082,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = Sources/AardvarkLoggingUI/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1120,7 +1120,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = Sources/AardvarkLoggingUI/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1148,7 +1148,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = Sources/AardvarkLoggingUITests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1177,7 +1177,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = Sources/AardvarkLoggingUITests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1209,7 +1209,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = Sources/AardvarkMailUI/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1248,7 +1248,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = Sources/AardvarkMailUI/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1277,7 +1277,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = Sources/AardvarkMailUITests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1307,7 +1307,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = Sources/AardvarkMailUITests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1336,7 +1336,7 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "$(SRCROOT)/Sources/Aardvark/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1368,7 +1368,7 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "$(SRCROOT)/Sources/Aardvark/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1398,7 +1398,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = EYF346PHUG; INFOPLIST_FILE = Sources/CoreAardvarkTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1426,7 +1426,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = EYF346PHUG; INFOPLIST_FILE = Sources/CoreAardvarkTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1452,7 +1452,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = EYF346PHUG; INFOPLIST_FILE = Sources/AardvarkTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1479,7 +1479,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = EYF346PHUG; INFOPLIST_FILE = Sources/AardvarkTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1544,7 +1544,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -1597,7 +1597,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; @@ -1623,7 +1623,7 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "$(SRCROOT)/Sources/CoreAardvark/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1638,7 +1638,7 @@ TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; - WATCHOS_DEPLOYMENT_TARGET = 4.0; + WATCHOS_DEPLOYMENT_TARGET = 7.0; }; name = Debug; }; @@ -1659,7 +1659,7 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "$(SRCROOT)/Sources/CoreAardvark/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1673,7 +1673,7 @@ TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; - WATCHOS_DEPLOYMENT_TARGET = 4.0; + WATCHOS_DEPLOYMENT_TARGET = 7.0; }; name = Release; }; diff --git a/Aardvark.xcodeproj/xcshareddata/xcschemes/Aardvark.xcscheme b/Aardvark.xcodeproj/xcshareddata/xcschemes/Aardvark.xcscheme index 2bb34808..dee6f507 100644 --- a/Aardvark.xcodeproj/xcshareddata/xcschemes/Aardvark.xcscheme +++ b/Aardvark.xcodeproj/xcshareddata/xcschemes/Aardvark.xcscheme @@ -1,6 +1,6 @@ 'https://github.com/square/Aardvark.git', :tag => "AardvarkLoggingUI/#{ s.version.to_s }" } s.swift_version = '5.0' - s.ios.deployment_target = '12.0' + s.ios.deployment_target = '14.0' s.source_files = 'Sources/AardvarkLoggingUI/**/*.{h,m,swift}' s.private_header_files = 'Sources/AardvarkLoggingUI/**/*_Testing.h', 'Sources/AardvarkLoggingUI/PrivateCategories/*.h' - s.dependency 'CoreAardvark', '~> 3.0' + s.dependency 'CoreAardvark', '~> 4.0' end diff --git a/AardvarkMailUI.podspec b/AardvarkMailUI.podspec index 97a87199..83a0c9b1 100644 --- a/AardvarkMailUI.podspec +++ b/AardvarkMailUI.podspec @@ -8,10 +8,10 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/square/Aardvark.git', :tag => "AardvarkMailUI/#{ s.version.to_s }" } s.swift_version = '5.0' - s.ios.deployment_target = '12.0' + s.ios.deployment_target = '14.0' s.source_files = 'Sources/AardvarkMailUI/**/*.{h,m,swift}' s.private_header_files = 'Sources/AardvarkMailUI/**/*_Testing.h', 'Sources/AardvarkMailUI/PrivateCategories/*.h' - s.dependency 'Aardvark', '~> 4.1.0' + s.dependency 'Aardvark', '~> 5.0.0' end diff --git a/AardvarkSample/AardvarkSample.xcodeproj/project.pbxproj b/AardvarkSample/AardvarkSample.xcodeproj/project.pbxproj index de79b1f2..cf2b2b34 100644 --- a/AardvarkSample/AardvarkSample.xcodeproj/project.pbxproj +++ b/AardvarkSample/AardvarkSample.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -246,8 +246,9 @@ EA3C1DD11D93696D0048C4CD /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 0800; - LastUpgradeCheck = 1220; + LastUpgradeCheck = 1500; ORGANIZATIONNAME = "Square, Inc."; TargetAttributes = { EA3C1DD81D93696D0048C4CD = { @@ -448,6 +449,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -462,7 +464,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -509,6 +511,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -517,10 +520,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; }; @@ -534,8 +538,11 @@ CLANG_ENABLE_MODULES = YES; DEVELOPMENT_TEAM = EYF346PHUG; INFOPLIST_FILE = AardvarkSample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.squareup.AardvarkSample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "AardvarkSample/AardvarkSample-Bridging-Header.h"; @@ -552,8 +559,11 @@ CLANG_ENABLE_MODULES = YES; DEVELOPMENT_TEAM = EYF346PHUG; INFOPLIST_FILE = AardvarkSample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = com.squareup.AardvarkSample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "AardvarkSample/AardvarkSample-Bridging-Header.h"; diff --git a/AardvarkSample/AardvarkSample.xcodeproj/xcshareddata/xcschemes/AardvarkSample.xcscheme b/AardvarkSample/AardvarkSample.xcodeproj/xcshareddata/xcschemes/AardvarkSample.xcscheme index fb855b5f..81841e3f 100644 --- a/AardvarkSample/AardvarkSample.xcodeproj/xcshareddata/xcschemes/AardvarkSample.xcscheme +++ b/AardvarkSample/AardvarkSample.xcodeproj/xcshareddata/xcschemes/AardvarkSample.xcscheme @@ -1,6 +1,6 @@ 'https://github.com/square/Aardvark.git', :tag => "CoreAardvark/#{ s.version.to_s }" } s.swift_version = '5.0' - s.ios.deployment_target = '12.0' - s.watchos.deployment_target = '4.0' + s.ios.deployment_target = '14.0' + s.watchos.deployment_target = '7.0' s.source_files = 'Sources/CoreAardvark/**/*.{h,m,swift}' s.private_header_files = 'Sources/CoreAardvark/**/*_Testing.h', 'Sources/CoreAardvark/PrivateCategories/*.h' diff --git a/README.md b/README.md index 816dc153..68f83645 100644 --- a/README.md +++ b/README.md @@ -96,9 +96,9 @@ Want to log with Aardvark but don’t want to use Aardvark’s bug reporting too ## Requirements -* Xcode 11.0 or later -* iOS 12.0 or later -* watchOS 4.0 or later +* Xcode 14.0 or later +* iOS 14.0 or later +* watchOS 7.0 or later ## Contributing diff --git a/Sources/Aardvark/UIApplication+ARKAdditions.swift b/Sources/Aardvark/UIApplication+ARKAdditions.swift index 6ca44360..feb6a2fb 100644 --- a/Sources/Aardvark/UIApplication+ARKAdditions.swift +++ b/Sources/Aardvark/UIApplication+ARKAdditions.swift @@ -41,6 +41,10 @@ extension UIApplication { return nil } + let keyWindow = connectedScenes + .flatMap { ($0 as? UIWindowScene)?.windows ?? [] } + .last { $0.isKeyWindow } + let bugReportingGestureRecognizer = triggeringGestureRecognizerClass.init( target: self, action: #selector(UIApplication.didFire(bugReportGestureRecognizer:)) diff --git a/Sources/AardvarkMailUI/ARKEmailBugReporter.h b/Sources/AardvarkMailUI/ARKEmailBugReporter.h index 57b4fab8..ee2bce2d 100644 --- a/Sources/AardvarkMailUI/ARKEmailBugReporter.h +++ b/Sources/AardvarkMailUI/ARKEmailBugReporter.h @@ -22,6 +22,7 @@ @class ARKEmailBugReportConfiguration; @class ARKEmailBugReporter; @class ARKLogStore; +@protocol ARKBugReporter; @protocol ARKLogFormatter; diff --git a/Sources/AardvarkMailUI/ARKEmailBugReporter.m b/Sources/AardvarkMailUI/ARKEmailBugReporter.m index f0850a61..b52dd7ed 100644 --- a/Sources/AardvarkMailUI/ARKEmailBugReporter.m +++ b/Sources/AardvarkMailUI/ARKEmailBugReporter.m @@ -113,7 +113,11 @@ - (void)composeBugReportWithScreenshot:(BOOL)attachScreenshot; ARKLogScreenshot(); // Flash the screen to simulate a screenshot being taken. - UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow; + UIWindow *keyWindow = [ARKEmailBugReporter _keyWindow]; + if (keyWindow == nil) { + return; + } + self.screenFlashView = [[UIView alloc] initWithFrame:keyWindow.frame]; self.screenFlashView.layer.opacity = 0.0f; self.screenFlashView.layer.backgroundColor = [[UIColor whiteColor] CGColor]; @@ -209,12 +213,10 @@ - (void)mailComposeController:(MFMailComposeViewController *)controller didFinis - (UIWindow *)emailComposeWindow; { if (!_emailComposeWindow) { - if (@available(iOS 13.0, *)) { - UIWindowScene *activeWindowScene = [[self class] _activeWindowScene]; - if (activeWindowScene != nil) { - _emailComposeWindow = [[UIWindow alloc] initWithWindowScene:activeWindowScene]; - return _emailComposeWindow; - } + UIWindowScene *activeWindowScene = [[self class] _activeWindowScene]; + if (activeWindowScene != nil) { + _emailComposeWindow = [[UIWindow alloc] initWithWindowScene:activeWindowScene]; + return _emailComposeWindow; } _emailComposeWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; @@ -374,8 +376,8 @@ - (void)_createBugReportWithConfiguration:(ARKEmailBugReportConfiguration *)conf - (void)_showEmailComposeWindow; { - self.previousKeyWindow = [UIApplication sharedApplication].keyWindow; - + self.previousKeyWindow = [ARKEmailBugReporter _keyWindow]; + [self.mailComposeViewController beginAppearanceTransition:YES animated:YES]; self.emailComposeWindow.rootViewController = self.mailComposeViewController; @@ -481,7 +483,7 @@ - (NSURL *)_emailURLWithPrefix:(NSString *)prefix recipients:(NSArray *)recipien #pragma mark - Private Static Methods -+ (UIWindowScene *)_activeWindowScene API_AVAILABLE(ios(13.0)); ++ (UIWindowScene *)_activeWindowScene; { NSSet *scenes = [[UIApplication sharedApplication] connectedScenes]; for (UIScene *scene in scenes) { @@ -492,6 +494,22 @@ + (UIWindowScene *)_activeWindowScene API_AVAILABLE(ios(13.0)); return nil; } ++ (UIWindow * _Nullable)_keyWindow; +{ + NSSet *scenes = [[UIApplication sharedApplication] connectedScenes]; + for (UIScene *scene in scenes) { + if ([scene isKindOfClass:[UIWindowScene class]]) { + NSArray *windows = [(UIWindowScene *)scene windows]; + for (UIWindow *window in windows) { + if (window.isKeyWindow) { + return window; + } + } + } + } + return nil; +} + @end @@ -535,7 +553,7 @@ - (void)showBugReportingPromptForConfiguration:(nonnull ARKEmailBugReportConfigu [self _configureAlertTextfield:textField]; }]; - UIViewController *viewControllerToPresentAlertController = [UIApplication sharedApplication].keyWindow.rootViewController; + UIViewController *viewControllerToPresentAlertController = [ARKEmailBugReporter _keyWindow].rootViewController; while (viewControllerToPresentAlertController.presentedViewController != nil) { viewControllerToPresentAlertController = viewControllerToPresentAlertController.presentedViewController; } @@ -550,7 +568,7 @@ - (void)_stealFirstResponder; { ARKInvisibleView *invisibleView = [ARKInvisibleView new]; invisibleView.layer.opacity = 0.0; - [[UIApplication sharedApplication].keyWindow addSubview:invisibleView]; + [[ARKEmailBugReporter _keyWindow] addSubview:invisibleView]; [invisibleView becomeFirstResponder]; [invisibleView removeFromSuperview]; } From 814d7c071664530988d12d00acdc6e8ce4760f57 Mon Sep 17 00:00:00 2001 From: Nicholas Entin Date: Wed, 20 Dec 2023 23:32:31 -0800 Subject: [PATCH 2/2] Update cocoapods to 1.14 --- Gemfile | 2 +- Gemfile.lock | 54 +++++++++++++++++++++++++++++++--------------------- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/Gemfile b/Gemfile index 5120c0a1..116623ca 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ source 'https://rubygems.org' -gem 'cocoapods', '~> 1.11.0' +gem 'cocoapods', '~> 1.14' diff --git a/Gemfile.lock b/Gemfile.lock index 7dab704b..e756a2ce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,30 +1,36 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.5) + CFPropertyList (3.0.6) rexml - activesupport (6.1.7.6) + activesupport (7.1.2) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) - zeitwerk (~> 2.3) - addressable (2.8.1) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) atomos (0.1.3) + base64 (0.2.0) + bigdecimal (3.1.5) claide (1.1.0) - cocoapods (1.11.3) + cocoapods (1.14.3) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.11.3) + cocoapods-core (= 1.14.3) cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-downloader (>= 2.1, < 3.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) @@ -32,10 +38,10 @@ GEM gh_inspector (~> 1.0) molinillo (~> 0.8.0) nap (~> 1.0) - ruby-macho (>= 1.0, < 3.0) - xcodeproj (>= 1.21.0, < 2.0) - cocoapods-core (1.11.3) - activesupport (>= 5.0, < 7) + ruby-macho (>= 2.3.0, < 3.0) + xcodeproj (>= 1.23.0, < 2.0) + cocoapods-core (1.14.3) + activesupport (>= 5.0, < 8) addressable (~> 2.8) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) @@ -45,7 +51,7 @@ GEM public_suffix (~> 4.0) typhoeus (~> 1.0) cocoapods-deintegrate (1.0.5) - cocoapods-downloader (1.6.3) + cocoapods-downloader (2.1) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.1) @@ -55,43 +61,47 @@ GEM cocoapods-try (1.2.0) colored2 (3.1.2) concurrent-ruby (1.2.2) + connection_pool (2.4.1) + drb (2.2.0) + ruby2_keywords escape (0.0.4) ethon (0.16.0) ffi (>= 1.15.0) - ffi (1.15.5) + ffi (1.16.3) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) i18n (1.14.1) concurrent-ruby (~> 1.0) - json (2.6.3) - minitest (5.19.0) + json (2.7.1) + minitest (5.20.0) molinillo (0.8.0) + mutex_m (0.2.0) nanaimo (0.3.0) nap (1.1.0) netrc (0.11.0) public_suffix (4.0.7) - rexml (3.2.5) + rexml (3.2.6) ruby-macho (2.5.1) - typhoeus (1.4.0) + ruby2_keywords (0.0.5) + typhoeus (1.4.1) ethon (>= 0.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - xcodeproj (1.22.0) + xcodeproj (1.23.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) nanaimo (~> 0.3.0) rexml (~> 3.2.4) - zeitwerk (2.6.11) PLATFORMS ruby DEPENDENCIES - cocoapods (~> 1.11.0) + cocoapods (~> 1.14) BUNDLED WITH - 2.3.15 + 2.4.10