From 5a26739b780a7638a24e8d236b7fc2383c620909 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 7 Nov 2021 14:35:14 -0500 Subject: [PATCH] Remove old compilation condition --- Tusker.xcodeproj/project.pbxproj | 3 --- .../Compose/ComposeHostingController.swift | 4 ---- .../ConversationTableViewController.swift | 19 +++++++------------ Tusker/Screens/Utilities/Previewing.swift | 8 -------- 4 files changed, 7 insertions(+), 27 deletions(-) diff --git a/Tusker.xcodeproj/project.pbxproj b/Tusker.xcodeproj/project.pbxproj index 622c902733..d23d669207 100644 --- a/Tusker.xcodeproj/project.pbxproj +++ b/Tusker.xcodeproj/project.pbxproj @@ -2632,9 +2632,6 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTS_MACCATALYST = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - "SWIFT_ACTIVE_COMPILATION_CONDITIONS[sdk=iphoneos15.0]" = "SDK_IOS_15 $(inherited)"; - "SWIFT_ACTIVE_COMPILATION_CONDITIONS[sdk=iphonesimulator15.0]" = "SDK_IOS_15 $(inherited)"; - "SWIFT_ACTIVE_COMPILATION_CONDITIONS[sdk=macosx12.0]" = "SDK_IOS_15 $(inherited)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,6"; }; diff --git a/Tusker/Screens/Compose/ComposeHostingController.swift b/Tusker/Screens/Compose/ComposeHostingController.swift index 7d386897ed..b66d7688a5 100644 --- a/Tusker/Screens/Compose/ComposeHostingController.swift +++ b/Tusker/Screens/Compose/ComposeHostingController.swift @@ -245,7 +245,6 @@ extension ComposeHostingController: ComposeUIStateDelegate { } func presentAssetPickerSheet() { - #if SDK_IOS_15 if #available(iOS 15.0, *) { let picker = AssetPickerViewController() picker.assetPickerDelegate = self @@ -258,9 +257,6 @@ extension ComposeHostingController: ComposeUIStateDelegate { } else { presentOldAssetPickerSheet() } - #else - presentOldAssetPickerSheet() - #endif } private func presentOldAssetPickerSheet() { diff --git a/Tusker/Screens/Conversation/ConversationTableViewController.swift b/Tusker/Screens/Conversation/ConversationTableViewController.swift index dec523a0af..1ab52a5269 100644 --- a/Tusker/Screens/Conversation/ConversationTableViewController.swift +++ b/Tusker/Screens/Conversation/ConversationTableViewController.swift @@ -326,16 +326,7 @@ class ConversationTableViewController: EnhancedTableViewController { } @objc func toggleVisibilityButtonPressed() { - #if SDK_IOS_15 - if #available(iOS 15.0, *) { - visibilityBarButtonItem.isSelected = !visibilityBarButtonItem.isSelected - showStatusesAutomatically = visibilityBarButtonItem.isSelected - } else { - showStatusesAutomatically = !showStatusesAutomatically - } - #else showStatusesAutomatically = !showStatusesAutomatically - #endif let snapshot = dataSource.snapshot() for case let .status(id: _, state: state) in snapshot.itemIdentifiers where state.collapsible == true { @@ -353,10 +344,14 @@ class ConversationTableViewController: EnhancedTableViewController { tableView.beginUpdates() tableView.endUpdates() - if showStatusesAutomatically { - visibilityBarButtonItem.image = ConversationTableViewController.hidePostsImage + if #available(iOS 15.0, *) { + visibilityBarButtonItem.isSelected = showStatusesAutomatically } else { - visibilityBarButtonItem.image = ConversationTableViewController.showPostsImage + if showStatusesAutomatically { + visibilityBarButtonItem.image = ConversationTableViewController.hidePostsImage + } else { + visibilityBarButtonItem.image = ConversationTableViewController.showPostsImage + } } } diff --git a/Tusker/Screens/Utilities/Previewing.swift b/Tusker/Screens/Utilities/Previewing.swift index c85e7577e4..2e932d3521 100644 --- a/Tusker/Screens/Utilities/Previewing.swift +++ b/Tusker/Screens/Utilities/Previewing.swift @@ -247,7 +247,6 @@ extension MenuPreviewProvider { } private func addOpenInNewWindow(actions: inout [UIAction], activity: @escaping @autoclosure () -> NSUserActivity) { - #if SDK_IOS_15 if #available(iOS 15.0, *) { let options = UIWindowScene.ActivationRequestOptions() options.preferredPresentationStyle = .automatic @@ -259,13 +258,6 @@ extension MenuPreviewProvider { UIApplication.shared.requestSceneSessionActivation(nil, userActivity: activity(), options: nil, errorHandler: nil) })) } - #else - if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac { - actions.append(createAction(identifier: "new_window", title: "Open in New Window", systemImageName: "rectangle.badge.plus", handler: { (_) in - UIApplication.shared.requestSceneSessionActivation(nil, userActivity: activity(), options: nil, errorHandler: nil) - })) - } - #endif } }