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 = "";
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";
};

View File

@ -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() {

View File

@ -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,12 +344,16 @@ class ConversationTableViewController: EnhancedTableViewController {
tableView.beginUpdates()
tableView.endUpdates()
if #available(iOS 15.0, *) {
visibilityBarButtonItem.isSelected = showStatusesAutomatically
} else {
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) {
#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
}
}