From ed1365281f55b5f65a4b5def6452ae551862d432 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Thu, 2 Mar 2023 16:53:36 -0600 Subject: [PATCH] Removes unnecessary #available checks --- AltStore/App IDs/AppIDsViewController.swift | 2 +- AltStore/AppDelegate.swift | 25 +-- AltStore/Components/AppIconImageView.swift | 15 +- .../Components/BannerCollectionViewCell.swift | 55 +++--- AltStore/Components/NavigationBar.swift | 60 +++---- AltStore/Managing Apps/AppManager.swift | 39 +---- AltStore/My Apps/MyAppsComponents.swift | 70 ++++---- AltStore/My Apps/MyAppsViewController.swift | 23 +-- .../Operations/AuthenticationOperation.swift | 5 +- .../ellipsis.circle.symbolset/Contents.json | 15 -- .../ellipsis.circle.svg | 161 ------------------ .../Error Log/ErrorLogViewController.swift | 32 ++-- AltStore/Sources/SourcesViewController.swift | 19 +-- AltStore/TabBarController.swift | 2 +- AltStoreCore/Patreon/PatreonAPI.swift | 6 +- 15 files changed, 117 insertions(+), 412 deletions(-) delete mode 100644 AltStore/Resources/Assets.xcassets/ellipsis.circle.symbolset/Contents.json delete mode 100644 AltStore/Resources/Assets.xcassets/ellipsis.circle.symbolset/ellipsis.circle.svg diff --git a/AltStore/App IDs/AppIDsViewController.swift b/AltStore/App IDs/AppIDsViewController.swift index 8f5ffefc..8aa86f04 100644 --- a/AltStore/App IDs/AppIDsViewController.swift +++ b/AltStore/App IDs/AppIDsViewController.swift @@ -120,7 +120,7 @@ private extension AppIDsViewController let attributedBundleIdentifier = NSMutableAttributedString(string: appID.bundleIdentifier.lowercased(), attributes: [.accessibilitySpeechPunctuation: true]) - if let team = appID.team, let range = attributedBundleIdentifier.string.range(of: team.identifier.lowercased()), #available(iOS 13, *) + if let team = appID.team, let range = attributedBundleIdentifier.string.range(of: team.identifier.lowercased()) { // Prefer to speak the team ID one character at a time. let nsRange = NSRange(range, in: attributedBundleIdentifier.string) diff --git a/AltStore/AppDelegate.swift b/AltStore/AppDelegate.swift index 082a1553..a6e2bee9 100644 --- a/AltStore/AppDelegate.swift +++ b/AltStore/AppDelegate.swift @@ -36,27 +36,8 @@ final class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - @available(iOS 14, *) - private var intentHandler: IntentHandler { - get { _intentHandler as! IntentHandler } - set { _intentHandler = newValue } - } - - @available(iOS 14, *) - private var viewAppIntentHandler: ViewAppIntentHandler { - get { _viewAppIntentHandler as! ViewAppIntentHandler } - set { _viewAppIntentHandler = newValue } - } - - private lazy var _intentHandler: Any = { - guard #available(iOS 14, *) else { fatalError() } - return IntentHandler() - }() - - private lazy var _viewAppIntentHandler: Any = { - guard #available(iOS 14, *) else { fatalError() } - return ViewAppIntentHandler() - }() + private let intentHandler = IntentHandler() + private let viewAppIntentHandler = ViewAppIntentHandler() func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { @@ -129,8 +110,6 @@ final class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, handlerFor intent: INIntent) -> Any? { - guard #available(iOS 14, *) else { return nil } - switch intent { case is RefreshAllIntent: return self.intentHandler diff --git a/AltStore/Components/AppIconImageView.swift b/AltStore/Components/AppIconImageView.swift index ccb207d8..5e1fa58e 100644 --- a/AltStore/Components/AppIconImageView.swift +++ b/AltStore/Components/AppIconImageView.swift @@ -16,20 +16,9 @@ final class AppIconImageView: UIImageView self.contentMode = .scaleAspectFill self.clipsToBounds = true - self.backgroundColor = .white - - if #available(iOS 13, *) - { - self.layer.cornerCurve = .continuous - } - else - { - if self.layer.responds(to: Selector(("continuousCorners"))) - { - self.layer.setValue(true, forKey: "continuousCorners") - } - } + + self.layer.cornerCurve = .continuous } override func layoutSubviews() diff --git a/AltStore/Components/BannerCollectionViewCell.swift b/AltStore/Components/BannerCollectionViewCell.swift index a1a810a8..fd0011ff 100644 --- a/AltStore/Components/BannerCollectionViewCell.swift +++ b/AltStore/Components/BannerCollectionViewCell.swift @@ -20,35 +20,32 @@ final class BannerCollectionViewCell: UICollectionViewCell self.contentView.autoresizingMask = [.flexibleWidth, .flexibleHeight] self.contentView.preservesSuperviewLayoutMargins = true - if #available(iOS 13.0, *) - { - let errorBadge = UIView() - errorBadge.translatesAutoresizingMaskIntoConstraints = false - errorBadge.isHidden = true - self.addSubview(errorBadge) + let errorBadge = UIView() + errorBadge.translatesAutoresizingMaskIntoConstraints = false + errorBadge.isHidden = true + self.addSubview(errorBadge) + + // Solid background to make the X opaque white. + let backgroundView = UIView() + backgroundView.translatesAutoresizingMaskIntoConstraints = false + backgroundView.backgroundColor = .white + errorBadge.addSubview(backgroundView) + + let badgeView = UIImageView(image: UIImage(systemName: "exclamationmark.circle.fill")) + badgeView.preferredSymbolConfiguration = UIImage.SymbolConfiguration(scale: .large) + badgeView.tintColor = .systemRed + errorBadge.addSubview(badgeView, pinningEdgesWith: .zero) + + NSLayoutConstraint.activate([ + errorBadge.centerXAnchor.constraint(equalTo: self.bannerView.trailingAnchor, constant: -5), + errorBadge.centerYAnchor.constraint(equalTo: self.bannerView.topAnchor, constant: 5), - // Solid background to make the X opaque white. - let backgroundView = UIView() - backgroundView.translatesAutoresizingMaskIntoConstraints = false - backgroundView.backgroundColor = .white - errorBadge.addSubview(backgroundView) - - let badgeView = UIImageView(image: UIImage(systemName: "exclamationmark.circle.fill")) - badgeView.preferredSymbolConfiguration = UIImage.SymbolConfiguration(scale: .large) - badgeView.tintColor = .systemRed - errorBadge.addSubview(badgeView, pinningEdgesWith: .zero) - - NSLayoutConstraint.activate([ - errorBadge.centerXAnchor.constraint(equalTo: self.bannerView.trailingAnchor, constant: -5), - errorBadge.centerYAnchor.constraint(equalTo: self.bannerView.topAnchor, constant: 5), - - backgroundView.centerXAnchor.constraint(equalTo: badgeView.centerXAnchor), - backgroundView.centerYAnchor.constraint(equalTo: badgeView.centerYAnchor), - backgroundView.widthAnchor.constraint(equalTo: badgeView.widthAnchor, multiplier: 0.5), - backgroundView.heightAnchor.constraint(equalTo: badgeView.heightAnchor, multiplier: 0.5) - ]) - - self.errorBadge = errorBadge - } + backgroundView.centerXAnchor.constraint(equalTo: badgeView.centerXAnchor), + backgroundView.centerYAnchor.constraint(equalTo: badgeView.centerYAnchor), + backgroundView.widthAnchor.constraint(equalTo: badgeView.widthAnchor, multiplier: 0.5), + backgroundView.heightAnchor.constraint(equalTo: badgeView.heightAnchor, multiplier: 0.5) + ]) + + self.errorBadge = errorBadge } } diff --git a/AltStore/Components/NavigationBar.swift b/AltStore/Components/NavigationBar.swift index beb46fac..2beb2789 100644 --- a/AltStore/Components/NavigationBar.swift +++ b/AltStore/Components/NavigationBar.swift @@ -32,53 +32,33 @@ final class NavigationBar: UINavigationBar private func initialize() { - if #available(iOS 13, *) + let standardAppearance = UINavigationBarAppearance() + standardAppearance.configureWithDefaultBackground() + standardAppearance.shadowColor = nil + + let edgeAppearance = UINavigationBarAppearance() + edgeAppearance.configureWithOpaqueBackground() + edgeAppearance.backgroundColor = self.barTintColor + edgeAppearance.shadowColor = nil + + if let tintColor = self.barTintColor { - let standardAppearance = UINavigationBarAppearance() - standardAppearance.configureWithDefaultBackground() - standardAppearance.shadowColor = nil + let textAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white] - let edgeAppearance = UINavigationBarAppearance() - edgeAppearance.configureWithOpaqueBackground() - edgeAppearance.backgroundColor = self.barTintColor - edgeAppearance.shadowColor = nil + standardAppearance.backgroundColor = tintColor + standardAppearance.titleTextAttributes = textAttributes + standardAppearance.largeTitleTextAttributes = textAttributes - if let tintColor = self.barTintColor - { - let textAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white] - - standardAppearance.backgroundColor = tintColor - standardAppearance.titleTextAttributes = textAttributes - standardAppearance.largeTitleTextAttributes = textAttributes - - edgeAppearance.titleTextAttributes = textAttributes - edgeAppearance.largeTitleTextAttributes = textAttributes - } - else - { - standardAppearance.backgroundColor = nil - } - - self.scrollEdgeAppearance = edgeAppearance - self.standardAppearance = standardAppearance + edgeAppearance.titleTextAttributes = textAttributes + edgeAppearance.largeTitleTextAttributes = textAttributes } else { - self.shadowImage = UIImage() - - if let tintColor = self.barTintColor - { - self.backgroundColorView.backgroundColor = tintColor - - // Top = -50 to cover status bar area above navigation bar on any device. - // Bottom = -1 to prevent a flickering gray line from appearing. - self.addSubview(self.backgroundColorView, pinningEdgesWith: UIEdgeInsets(top: -50, left: 0, bottom: -1, right: 0)) - } - else - { - self.barTintColor = .white - } + standardAppearance.backgroundColor = nil } + + self.scrollEdgeAppearance = edgeAppearance + self.standardAppearance = standardAppearance } override func layoutSubviews() diff --git a/AltStore/Managing Apps/AppManager.swift b/AltStore/Managing Apps/AppManager.swift index 7c66b4a7..b878ad3c 100644 --- a/AltStore/Managing Apps/AppManager.swift +++ b/AltStore/Managing Apps/AppManager.swift @@ -53,16 +53,14 @@ final class AppManager private let operationQueue = OperationQueue() private let serialOperationQueue = OperationQueue() - + private var installationProgress = [String: Progress]() { didSet { - guard #available(iOS 13, *) else { return } self.publisher.installationProgress = self.installationProgress } } private var refreshProgress = [String: Progress]() { didSet { - guard #available(iOS 13, *) else { return } self.publisher.refreshProgress = self.refreshProgress } } @@ -76,27 +74,8 @@ final class AppManager return lock }() - @available(iOS 13, *) - private(set) var publisher: AppManagerPublisher { - get { _publisher as! AppManagerPublisher } - set { _publisher = newValue } - } - - @available(iOS 13, *) - private(set) var cancellables: Set { - get { _cancellables as! Set } - set { _cancellables = newValue } - } - - private lazy var _publisher: Any = { - guard #available(iOS 13, *) else { fatalError() } - return AppManagerPublisher() - }() - - private lazy var _cancellables: Any = { - guard #available(iOS 13, *) else { fatalError() } - return Set() - }() + private let publisher = AppManagerPublisher() + private var cancellables: Set = [] private init() { @@ -105,10 +84,7 @@ final class AppManager self.serialOperationQueue.name = "com.altstore.AppManager.serialOperationQueue" self.serialOperationQueue.maxConcurrentOperationCount = 1 - if #available(iOS 13, *) - { - self.prepareSubscriptions() - } + self.prepareSubscriptions() } deinit @@ -1387,7 +1363,7 @@ private extension AppManager return } - guard let presentingViewController = context.presentingViewController, #available(iOS 14, *) else { return operation.finish() } + guard let presentingViewController = context.presentingViewController else { return operation.finish() } if let error = context.error { @@ -1978,10 +1954,7 @@ private extension AppManager AnalyticsManager.shared.trackEvent(event) } - if #available(iOS 14, *) - { - WidgetCenter.shared.reloadAllTimelines() - } + WidgetCenter.shared.reloadAllTimelines() do { try installedApp.managedObjectContext?.save() } catch { print("Error saving installed app.", error) } diff --git a/AltStore/My Apps/MyAppsComponents.swift b/AltStore/My Apps/MyAppsComponents.swift index e4f9682f..593d86bc 100644 --- a/AltStore/My Apps/MyAppsComponents.swift +++ b/AltStore/My Apps/MyAppsComponents.swift @@ -22,36 +22,33 @@ final class InstalledAppCollectionViewCell: UICollectionViewCell self.contentView.autoresizingMask = [.flexibleWidth, .flexibleHeight] self.contentView.preservesSuperviewLayoutMargins = true - if #available(iOS 13.0, *) - { - let deactivateBadge = UIView() - deactivateBadge.translatesAutoresizingMaskIntoConstraints = false - deactivateBadge.isHidden = true - self.addSubview(deactivateBadge) + let deactivateBadge = UIView() + deactivateBadge.translatesAutoresizingMaskIntoConstraints = false + deactivateBadge.isHidden = true + self.addSubview(deactivateBadge) + + // Solid background to make the X opaque white. + let backgroundView = UIView() + backgroundView.translatesAutoresizingMaskIntoConstraints = false + backgroundView.backgroundColor = .white + deactivateBadge.addSubview(backgroundView) + + let badgeView = UIImageView(image: UIImage(systemName: "xmark.circle.fill")) + badgeView.preferredSymbolConfiguration = UIImage.SymbolConfiguration(scale: .large) + badgeView.tintColor = .systemRed + deactivateBadge.addSubview(badgeView, pinningEdgesWith: .zero) + + NSLayoutConstraint.activate([ + deactivateBadge.centerXAnchor.constraint(equalTo: self.bannerView.iconImageView.trailingAnchor), + deactivateBadge.centerYAnchor.constraint(equalTo: self.bannerView.iconImageView.topAnchor), - // Solid background to make the X opaque white. - let backgroundView = UIView() - backgroundView.translatesAutoresizingMaskIntoConstraints = false - backgroundView.backgroundColor = .white - deactivateBadge.addSubview(backgroundView) - - let badgeView = UIImageView(image: UIImage(systemName: "xmark.circle.fill")) - badgeView.preferredSymbolConfiguration = UIImage.SymbolConfiguration(scale: .large) - badgeView.tintColor = .systemRed - deactivateBadge.addSubview(badgeView, pinningEdgesWith: .zero) - - NSLayoutConstraint.activate([ - deactivateBadge.centerXAnchor.constraint(equalTo: self.bannerView.iconImageView.trailingAnchor), - deactivateBadge.centerYAnchor.constraint(equalTo: self.bannerView.iconImageView.topAnchor), - - backgroundView.centerXAnchor.constraint(equalTo: badgeView.centerXAnchor), - backgroundView.centerYAnchor.constraint(equalTo: badgeView.centerYAnchor), - backgroundView.widthAnchor.constraint(equalTo: badgeView.widthAnchor, multiplier: 0.5), - backgroundView.heightAnchor.constraint(equalTo: badgeView.heightAnchor, multiplier: 0.5) - ]) - - self.deactivateBadge = deactivateBadge - } + backgroundView.centerXAnchor.constraint(equalTo: badgeView.centerXAnchor), + backgroundView.centerYAnchor.constraint(equalTo: badgeView.centerYAnchor), + backgroundView.widthAnchor.constraint(equalTo: badgeView.widthAnchor, multiplier: 0.5), + backgroundView.heightAnchor.constraint(equalTo: badgeView.heightAnchor, multiplier: 0.5) + ]) + + self.deactivateBadge = deactivateBadge } } @@ -73,18 +70,9 @@ final class NoUpdatesCollectionViewCell: UICollectionViewCell self.contentView.preservesSuperviewLayoutMargins = true - let image: UIImage? - if #available(iOS 13, *) - { - let font = self.textLabel.font ?? UIFont.systemFont(ofSize: 17) - let configuration = UIImage.SymbolConfiguration(font: font) - - image = UIImage(systemName: "ellipsis.circle", withConfiguration: configuration) - } - else - { - image = UIImage(named: "ellipsis.circle") - } + let font = self.textLabel.font ?? UIFont.systemFont(ofSize: 17) + let configuration = UIImage.SymbolConfiguration(font: font) + let image = UIImage(systemName: "ellipsis.circle", withConfiguration: configuration) self.button.setTitle("", for: .normal) self.button.setImage(image, for: .normal) diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index 7a67a8c8..075bc1dd 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -707,13 +707,10 @@ private extension MyAppsViewController } } - if #available(iOS 14, *) - { - let interaction = INInteraction.refreshAllApps() - interaction.donate { (error) in - guard let error = error else { return } - print("Failed to donate intent \(interaction.intent).", error) - } + let interaction = INInteraction.refreshAllApps() + interaction.donate { (error) in + guard let error = error else { return } + print("Failed to donate intent \(interaction.intent).", error) } } @@ -1145,8 +1142,6 @@ private extension MyAppsViewController if !UserDefaults.standard.isAppLimitDisabled && UserDefaults.standard.activeAppsLimit != nil, #available(iOS 13, *) { - // UserDefaults.standard.activeAppsLimit is only non-nil on iOS 13.3.1 or later, so the #available check is just so we can use Combine. - guard let app = ALTApplication(fileURL: installedApp.fileURL) else { return finish(.failure(OperationError.invalidApp)) } var cancellable: AnyCancellable? @@ -1595,12 +1590,7 @@ extension MyAppsViewController headerView.textLabel.text = NSLocalizedString("Inactive", comment: "") headerView.button.setTitle(nil, for: .normal) - - if #available(iOS 13.0, *) - { - headerView.button.setImage(UIImage(systemName: "questionmark.circle"), for: .normal) - } - + headerView.button.setImage(UIImage(systemName: "questionmark.circle"), for: .normal) headerView.button.addTarget(self, action: #selector(MyAppsViewController.presentInactiveAppsAlert), for: .primaryActionTriggered) } @@ -1681,7 +1671,6 @@ extension MyAppsViewController } let jitAction = UIAction(title: NSLocalizedString("Enable JIT", comment: ""), image: UIImage(systemName: "bolt")) { (action) in - guard #available(iOS 14, *) else { return } self.enableJIT(for: installedApp) } @@ -1731,7 +1720,7 @@ extension MyAppsViewController actions.append(activateAction) } - if installedApp.isActive, #available(iOS 14, *) + if installedApp.isActive { actions.append(jitAction) } diff --git a/AltStore/Operations/AuthenticationOperation.swift b/AltStore/Operations/AuthenticationOperation.swift index 988c6e9b..40ef1e1d 100644 --- a/AltStore/Operations/AuthenticationOperation.swift +++ b/AltStore/Operations/AuthenticationOperation.swift @@ -49,10 +49,7 @@ final class AuthenticationOperation: ResultOperation<(ALTTeam, ALTCertificate, A private lazy var navigationController: UINavigationController = { let navigationController = self.storyboard.instantiateViewController(withIdentifier: "navigationController") as! UINavigationController - if #available(iOS 13.0, *) - { - navigationController.isModalInPresentation = true - } + navigationController.isModalInPresentation = true return navigationController }() diff --git a/AltStore/Resources/Assets.xcassets/ellipsis.circle.symbolset/Contents.json b/AltStore/Resources/Assets.xcassets/ellipsis.circle.symbolset/Contents.json deleted file mode 100644 index 314b583c..00000000 --- a/AltStore/Resources/Assets.xcassets/ellipsis.circle.symbolset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "symbol-rendering-intent" : "template" - }, - "symbols" : [ - { - "filename" : "ellipsis.circle.svg", - "idiom" : "universal" - } - ] -} diff --git a/AltStore/Resources/Assets.xcassets/ellipsis.circle.symbolset/ellipsis.circle.svg b/AltStore/Resources/Assets.xcassets/ellipsis.circle.symbolset/ellipsis.circle.svg deleted file mode 100644 index 064041d1..00000000 --- a/AltStore/Resources/Assets.xcassets/ellipsis.circle.symbolset/ellipsis.circle.svg +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - Weight/Scale Variations - Ultralight - Thin - Light - Regular - Medium - Semibold - Bold - Heavy - Black - - - - - - - - - - - Design Variations - Symbols are supported in up to nine weights and three scales. - For optimal layout with text and other symbols, vertically align - symbols with the adjacent text. - - - - - - Margins - Leading and trailing margins on the left and right side of each symbol - can be adjusted by modifying the x-location of the margin guidelines. - Modifications are automatically applied proportionally to all - scales and weights. - - - - Exporting - Symbols should be outlined when exporting to ensure the - design is preserved when submitting to Xcode. - Template v.3.0 - Requires Xcode 13 or greater - Generated from ellipsis.circle - Typeset at 100 points - Small - Medium - Large - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AltStore/Settings/Error Log/ErrorLogViewController.swift b/AltStore/Settings/Error Log/ErrorLogViewController.swift index 2dac9563..9dde24e4 100644 --- a/AltStore/Settings/Error Log/ErrorLogViewController.swift +++ b/AltStore/Settings/Error Log/ErrorLogViewController.swift @@ -96,22 +96,20 @@ private extension ErrorLogViewController let displayScale = (self.traitCollection.displayScale == 0.0) ? 1.0 : self.traitCollection.displayScale // 0.0 == "unspecified" cell.appIconImageView.layer.borderWidth = 1.0 / displayScale - if #available(iOS 14, *) - { - let menu = UIMenu(title: "", children: [ - UIAction(title: NSLocalizedString("Copy Error Message", comment: ""), image: UIImage(systemName: "doc.on.doc")) { [weak self] _ in - self?.copyErrorMessage(for: loggedError) - }, - UIAction(title: NSLocalizedString("Copy Error Code", comment: ""), image: UIImage(systemName: "doc.on.doc")) { [weak self] _ in - self?.copyErrorCode(for: loggedError) - }, - UIAction(title: NSLocalizedString("Search FAQ", comment: ""), image: UIImage(systemName: "magnifyingglass")) { [weak self] _ in - self?.searchFAQ(for: loggedError) - }, - UIAction(title: NSLocalizedString("View More Details", comment: ""), image: UIImage(systemName: "ellipsis.circle")) { [weak self] _ in - self?.viewMoreDetails(for: loggedError) - }, - ]) + let menu = UIMenu(title: "", children: [ + UIAction(title: NSLocalizedString("Copy Error Message", comment: ""), image: UIImage(systemName: "doc.on.doc")) { [weak self] _ in + self?.copyErrorMessage(for: loggedError) + }, + UIAction(title: NSLocalizedString("Copy Error Code", comment: ""), image: UIImage(systemName: "doc.on.doc")) { [weak self] _ in + self?.copyErrorCode(for: loggedError) + }, + UIAction(title: NSLocalizedString("Search FAQ", comment: ""), image: UIImage(systemName: "magnifyingglass")) { [weak self] _ in + self?.searchFAQ(for: loggedError) + }, + UIAction(title: NSLocalizedString("View More Details", comment: ""), image: UIImage(systemName: "ellipsis.circle")) { [weak self] _ in + self?.viewMoreDetails(for: loggedError) + }, + ]) cell.menuButton.menu = menu cell.menuButton.showsMenuAsPrimaryAction = self.isScrolling ? false : true @@ -362,8 +360,6 @@ extension ErrorLogViewController } private func updateButtonInteractivity() { - guard #available(iOS 14, *) else { return } - for case let cell as ErrorLogTableViewCell in self.tableView.visibleCells { cell.menuButton.showsMenuAsPrimaryAction = self.isScrolling ? false : true diff --git a/AltStore/Sources/SourcesViewController.swift b/AltStore/Sources/SourcesViewController.swift index 8c86ecc7..350f8dcf 100644 --- a/AltStore/Sources/SourcesViewController.swift +++ b/AltStore/Sources/SourcesViewController.swift @@ -134,18 +134,15 @@ private extension SourcesViewController // Source exists in .added section, so hide the button. cell.bannerView.button.isHidden = true - if #available(iOS 13.0, *) - { - let configuation = UIImage.SymbolConfiguration(pointSize: 24) - - let imageAttachment = NSTextAttachment() - imageAttachment.image = UIImage(systemName: "checkmark.circle", withConfiguration: configuation)?.withTintColor(.altPrimary) + let configuation = UIImage.SymbolConfiguration(pointSize: 24) + + let imageAttachment = NSTextAttachment() + imageAttachment.image = UIImage(systemName: "checkmark.circle", withConfiguration: configuation)?.withTintColor(.altPrimary) - let attributedText = NSAttributedString(attachment: imageAttachment) - cell.bannerView.buttonLabel.attributedText = attributedText - cell.bannerView.buttonLabel.textAlignment = .center - cell.bannerView.buttonLabel.isHidden = false - } + let attributedText = NSAttributedString(attachment: imageAttachment) + cell.bannerView.buttonLabel.attributedText = attributedText + cell.bannerView.buttonLabel.textAlignment = .center + cell.bannerView.buttonLabel.isHidden = false } else { diff --git a/AltStore/TabBarController.swift b/AltStore/TabBarController.swift index f9c84600..57d5f1ac 100644 --- a/AltStore/TabBarController.swift +++ b/AltStore/TabBarController.swift @@ -73,7 +73,7 @@ final class TabBarController: UITabBarController sourcesViewController.deepLinkSourceURL = sourceURL case "finishJailbreak": - guard let installedApp = sender as? InstalledApp, #available(iOS 14, *) else { return } + guard let installedApp = sender as? InstalledApp else { return } let navigationController = segue.destination as! UINavigationController diff --git a/AltStoreCore/Patreon/PatreonAPI.swift b/AltStoreCore/Patreon/PatreonAPI.swift index 43d9453b..0eae5c7f 100644 --- a/AltStoreCore/Patreon/PatreonAPI.swift +++ b/AltStoreCore/Patreon/PatreonAPI.swift @@ -148,11 +148,7 @@ public extension PatreonAPI } } - if #available(iOS 13.0, *) - { - self.authenticationSession?.presentationContextProvider = self - } - + self.authenticationSession?.presentationContextProvider = self self.authenticationSession?.start() }