From b6c0c02028fa56367e81d6e8b309a0d88ca91e06 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 20 Sep 2020 11:34:09 -0400 Subject: [PATCH] Remove no longer necessary conditional compilation directives --- Tusker/SceneDelegate.swift | 4 ---- Tusker/Screens/Compose/ComposeDrawingViewController.swift | 4 ---- Tusker/Screens/Main/MainSidebarViewController.swift | 2 -- Tusker/Screens/Main/MainSplitViewController.swift | 2 -- Tusker/Screens/Utilities/Previewing.swift | 3 --- Tusker/Views/Profile Header/ProfileHeaderView.swift | 2 -- Tusker/Views/Status/BaseStatusTableViewCell.swift | 4 ---- Tusker/Views/VisualEffectImageButton.swift | 4 ---- 8 files changed, 25 deletions(-) diff --git a/Tusker/SceneDelegate.swift b/Tusker/SceneDelegate.swift index 1cd872f983..27eccb6dca 100644 --- a/Tusker/SceneDelegate.swift +++ b/Tusker/SceneDelegate.swift @@ -158,15 +158,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { mastodonController.getOwnInstance() let rootController: UIViewController - #if SDK_IOS_14 if #available(iOS 14.0, *) { rootController = MainSplitViewController(mastodonController: mastodonController) } else { rootController = MainTabBarViewController(mastodonController: mastodonController) } - #else - rootController = MainTabBarViewController(mastodonController: mastodonController) - #endif window!.rootViewController = rootController } diff --git a/Tusker/Screens/Compose/ComposeDrawingViewController.swift b/Tusker/Screens/Compose/ComposeDrawingViewController.swift index 9396040582..14945e6265 100644 --- a/Tusker/Screens/Compose/ComposeDrawingViewController.swift +++ b/Tusker/Screens/Compose/ComposeDrawingViewController.swift @@ -58,15 +58,11 @@ class ComposeDrawingViewController: UIViewController { canvasView.drawing = initialDrawing } canvasView.delegate = self - #if SDK_IOS_14 if #available(iOS 14.0, *) { canvasView.drawingPolicy = .anyInput } else { canvasView.allowsFingerDrawing = true } - #else - canvasView.allowsFingerDrawing = true - #endif canvasView.minimumZoomScale = 0.5 canvasView.maximumZoomScale = 2 canvasView.backgroundColor = .systemBackground diff --git a/Tusker/Screens/Main/MainSidebarViewController.swift b/Tusker/Screens/Main/MainSidebarViewController.swift index acd32ba631..5294637dc6 100644 --- a/Tusker/Screens/Main/MainSidebarViewController.swift +++ b/Tusker/Screens/Main/MainSidebarViewController.swift @@ -9,7 +9,6 @@ import UIKit import Pachyderm -#if SDK_IOS_14 @available(iOS 14.0, *) protocol MainSidebarViewControllerDelegate: class { func sidebarRequestPresentCompose(_ sidebarViewController: MainSidebarViewController) @@ -380,4 +379,3 @@ extension MainSidebarViewController: InstanceTimelineViewControllerDelegate { dismiss(animated: true) } } -#endif diff --git a/Tusker/Screens/Main/MainSplitViewController.swift b/Tusker/Screens/Main/MainSplitViewController.swift index 5b6bd7d7d6..c11b65d45f 100644 --- a/Tusker/Screens/Main/MainSplitViewController.swift +++ b/Tusker/Screens/Main/MainSplitViewController.swift @@ -8,7 +8,6 @@ import UIKit -#if SDK_IOS_14 @available(iOS 14.0, *) class MainSplitViewController: UISplitViewController { @@ -323,4 +322,3 @@ extension MainSplitViewController: TuskerRootViewController { } } } -#endif diff --git a/Tusker/Screens/Utilities/Previewing.swift b/Tusker/Screens/Utilities/Previewing.swift index 0f14180795..a9ddb07853 100644 --- a/Tusker/Screens/Utilities/Previewing.swift +++ b/Tusker/Screens/Utilities/Previewing.swift @@ -54,8 +54,6 @@ extension MenuPreviewProvider { }), ] - // todo: handle pre-iOS 14 - #if SDK_IOS_14 if accountID != mastodonController.account.id, #available(iOS 14.0, *) { actionsSection.append(UIDeferredMenuElement({ (elementHandler) in @@ -82,7 +80,6 @@ extension MenuPreviewProvider { } })) } - #endif let shareSection = [ openInSafariAction(url: account.url), diff --git a/Tusker/Views/Profile Header/ProfileHeaderView.swift b/Tusker/Views/Profile Header/ProfileHeaderView.swift index b4219e85d6..ca2f469678 100644 --- a/Tusker/Views/Profile Header/ProfileHeaderView.swift +++ b/Tusker/Views/Profile Header/ProfileHeaderView.swift @@ -70,12 +70,10 @@ class ProfileHeaderView: UIView { if #available(iOS 13.4, *) { moreButton.addInteraction(UIPointerInteraction(delegate: self)) } - #if SDK_IOS_14 if #available(iOS 14.0, *) { moreButton.showsMenuAsPrimaryAction = true moreButton.isContextMenuInteractionEnabled = true } - #endif } func updateUI(for accountID: String) { diff --git a/Tusker/Views/Status/BaseStatusTableViewCell.swift b/Tusker/Views/Status/BaseStatusTableViewCell.swift index b93e5b693f..117ccca341 100644 --- a/Tusker/Views/Status/BaseStatusTableViewCell.swift +++ b/Tusker/Views/Status/BaseStatusTableViewCell.swift @@ -87,11 +87,9 @@ class BaseStatusTableViewCell: UITableViewCell { accessibilityElements = [displayNameLabel!, contentWarningLabel!, collapseButton!, contentTextView!, attachmentsView!] attachmentsView.isAccessibilityElement = true - #if SDK_IOS_14 if #available(iOS 14.0, *) { moreButton.showsMenuAsPrimaryAction = true } - #endif NotificationCenter.default.addObserver(self, selector: #selector(preferencesChanged), name: .preferencesChanged, object: nil) } @@ -200,12 +198,10 @@ class BaseStatusTableViewCell: UITableViewCell { reblogButton.accessibilityLabel = NSLocalizedString("Reblog", comment: "reblog button accessibility label") } - #if SDK_IOS_14 if #available(iOS 14.0, *) { // keep menu in sync with changed states e.g. bookmarked, muted moreButton.menu = UIMenu(title: "", image: nil, identifier: nil, options: [], children: actionsForStatus(statusID: statusID, sourceView: moreButton)) } - #endif } func updateUI(account: AccountMO) { diff --git a/Tusker/Views/VisualEffectImageButton.swift b/Tusker/Views/VisualEffectImageButton.swift index c56706b9d6..9b04a21298 100644 --- a/Tusker/Views/VisualEffectImageButton.swift +++ b/Tusker/Views/VisualEffectImageButton.swift @@ -52,9 +52,7 @@ class VisualEffectImageButton: UIControl { imageView.bottomAnchor.constraint(equalTo: vibrancyView.bottomAnchor, constant: -2), ]) - #if SDK_IOS_14 addInteraction(UIContextMenuInteraction(delegate: self)) - #endif addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(onTap))) } @@ -63,12 +61,10 @@ class VisualEffectImageButton: UIControl { sendActions(for: .touchUpInside) } - #if SDK_IOS_14 override func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration? { guard let menu = menu else { return nil } return UIContextMenuConfiguration(identifier: nil, previewProvider: nil) { (_) -> UIMenu? in return menu } } - #endif }