Remove old compilation condition

This commit is contained in:
Shadowfacts 2021-11-07 14:35:14 -05:00
parent 36a78f1a3c
commit 5a26739b78
4 changed files with 7 additions and 27 deletions

View File

@ -2632,9 +2632,6 @@
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTS_MACCATALYST = YES; SUPPORTS_MACCATALYST = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 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; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,6"; TARGETED_DEVICE_FAMILY = "1,2,6";
}; };

View File

@ -245,7 +245,6 @@ extension ComposeHostingController: ComposeUIStateDelegate {
} }
func presentAssetPickerSheet() { func presentAssetPickerSheet() {
#if SDK_IOS_15
if #available(iOS 15.0, *) { if #available(iOS 15.0, *) {
let picker = AssetPickerViewController() let picker = AssetPickerViewController()
picker.assetPickerDelegate = self picker.assetPickerDelegate = self
@ -258,9 +257,6 @@ extension ComposeHostingController: ComposeUIStateDelegate {
} else { } else {
presentOldAssetPickerSheet() presentOldAssetPickerSheet()
} }
#else
presentOldAssetPickerSheet()
#endif
} }
private func presentOldAssetPickerSheet() { private func presentOldAssetPickerSheet() {

View File

@ -326,16 +326,7 @@ class ConversationTableViewController: EnhancedTableViewController {
} }
@objc func toggleVisibilityButtonPressed() { @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 showStatusesAutomatically = !showStatusesAutomatically
#endif
let snapshot = dataSource.snapshot() let snapshot = dataSource.snapshot()
for case let .status(id: _, state: state) in snapshot.itemIdentifiers where state.collapsible == true { for case let .status(id: _, state: state) in snapshot.itemIdentifiers where state.collapsible == true {
@ -353,10 +344,14 @@ class ConversationTableViewController: EnhancedTableViewController {
tableView.beginUpdates() tableView.beginUpdates()
tableView.endUpdates() tableView.endUpdates()
if showStatusesAutomatically { if #available(iOS 15.0, *) {
visibilityBarButtonItem.image = ConversationTableViewController.hidePostsImage visibilityBarButtonItem.isSelected = showStatusesAutomatically
} else { } else {
visibilityBarButtonItem.image = ConversationTableViewController.showPostsImage if showStatusesAutomatically {
visibilityBarButtonItem.image = ConversationTableViewController.hidePostsImage
} else {
visibilityBarButtonItem.image = ConversationTableViewController.showPostsImage
}
} }
} }

View File

@ -247,7 +247,6 @@ extension MenuPreviewProvider {
} }
private func addOpenInNewWindow(actions: inout [UIAction], activity: @escaping @autoclosure () -> NSUserActivity) { private func addOpenInNewWindow(actions: inout [UIAction], activity: @escaping @autoclosure () -> NSUserActivity) {
#if SDK_IOS_15
if #available(iOS 15.0, *) { if #available(iOS 15.0, *) {
let options = UIWindowScene.ActivationRequestOptions() let options = UIWindowScene.ActivationRequestOptions()
options.preferredPresentationStyle = .automatic options.preferredPresentationStyle = .automatic
@ -259,13 +258,6 @@ extension MenuPreviewProvider {
UIApplication.shared.requestSceneSessionActivation(nil, userActivity: activity(), options: nil, errorHandler: nil) 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
} }
} }