diff --git a/Core/DefaultVariantManager.swift b/Core/DefaultVariantManager.swift index 588afe4e17..13a757f182 100644 --- a/Core/DefaultVariantManager.swift +++ b/Core/DefaultVariantManager.swift @@ -40,13 +40,6 @@ public struct VariantIOS: Variant { .contains(where: { Locale.current.regionCode == $0 }) } static let inEnglish = { return Locale.current.languageCode == "en" } - - static let iOS15 = { () -> Bool in - if #available(iOS 15, *) { - return true - } - return false - } } /// This variant is used for returning users to separate them from really new users. diff --git a/DuckDuckGo/AnimatableTypingText.swift b/DuckDuckGo/AnimatableTypingText.swift index 7e323f99af..b391d447f0 100644 --- a/DuckDuckGo/AnimatableTypingText.swift +++ b/DuckDuckGo/AnimatableTypingText.swift @@ -47,13 +47,8 @@ struct AnimatableTypingText: View { .frame(maxWidth: .infinity, alignment: .leading) .visibility(.invisible) - if #available(iOS 15, *) { - Text(AttributedString(model.typedAttributedText)) - .frame(maxWidth: .infinity, alignment: .leading) - } else { - Text(model.typedAttributedText.string) - .frame(maxWidth: .infinity, alignment: .leading) - } + Text(AttributedString(model.typedAttributedText)) + .frame(maxWidth: .infinity, alignment: .leading) } .onChange(of: startAnimating.wrappedValue, perform: { shouldAnimate in if shouldAnimate { @@ -128,10 +123,6 @@ final class AnimatableTypingTextModel: ObservableObject { private func showCharacter() { func attributedTypedString(forTypedChars typedChars: [String.Element]) -> NSAttributedString { - guard #available(iOS 15, *) else { - return NSAttributedString(string: String(typedChars)) - } - let chars = Array(text) let untypedChars = chars[typedChars.count ..< chars.count] let combined = NSMutableAttributedString(string: String(typedChars)) diff --git a/DuckDuckGo/AppDelegate.swift b/DuckDuckGo/AppDelegate.swift index 69dc0b2f90..9e2b6175f7 100644 --- a/DuckDuckGo/AppDelegate.swift +++ b/DuckDuckGo/AppDelegate.swift @@ -996,10 +996,8 @@ extension AppDelegate: UNUserNotificationCenterDelegate { Task { if case .success(let hasEntitlements) = await accountManager.hasEntitlement(forProductName: .networkProtection), hasEntitlements { - if #available(iOS 15, *) { - let networkProtectionRoot = NetworkProtectionRootViewController() - presentSettings(with: networkProtectionRoot) - } + let networkProtectionRoot = NetworkProtectionRootViewController() + presentSettings(with: networkProtectionRoot) } else { (window?.rootViewController as? MainViewController)?.segueToPrivacyPro() } diff --git a/DuckDuckGo/AutofillLoginDetailsView.swift b/DuckDuckGo/AutofillLoginDetailsView.swift index d645e9b346..24ab1f5421 100644 --- a/DuckDuckGo/AutofillLoginDetailsView.swift +++ b/DuckDuckGo/AutofillLoginDetailsView.swift @@ -191,27 +191,19 @@ struct AutofillLoginDetailsView: View { usernameCell() } footer: { if !viewModel.isSignedIn { - if #available(iOS 15, *) { - var attributedString: AttributedString { - let text = String(format: UserText.autofillSignInToManageEmail, UserText.autofillEnableEmailProtection) - var attributedString = AttributedString(text) - if let range = attributedString.range(of: UserText.autofillEnableEmailProtection) { - attributedString[range].foregroundColor = Color(ThemeManager.shared.currentTheme.buttonTintColor) - } - return attributedString + var attributedString: AttributedString { + let text = String(format: UserText.autofillSignInToManageEmail, UserText.autofillEnableEmailProtection) + var attributedString = AttributedString(text) + if let range = attributedString.range(of: UserText.autofillEnableEmailProtection) { + attributedString[range].foregroundColor = Color(ThemeManager.shared.currentTheme.buttonTintColor) } - Text(attributedString) - .font(.footnote) - .lineLimit(nil) - .multilineTextAlignment(.leading) - .fixedSize(horizontal: false, vertical: true) - } else { - Text(String(format: UserText.autofillSignInToManageEmail, UserText.autofillEnableEmailProtection)) - .font(.footnote) - .lineLimit(nil) - .multilineTextAlignment(.leading) - .fixedSize(horizontal: false, vertical: true) + return attributedString } + Text(attributedString) + .font(.footnote) + .lineLimit(nil) + .multilineTextAlignment(.leading) + .fixedSize(horizontal: false, vertical: true) } } .onTapGesture { diff --git a/DuckDuckGo/HistoryDebugViewController.swift b/DuckDuckGo/HistoryDebugViewController.swift index 3d516818c3..a92a5b1dac 100644 --- a/DuckDuckGo/HistoryDebugViewController.swift +++ b/DuckDuckGo/HistoryDebugViewController.swift @@ -49,10 +49,8 @@ struct HistoryDebugRootView: View { } .navigationTitle("\(model.history.count) History Items") .toolbar { - if #available(iOS 15, *) { - Button("Delete All", role: .destructive) { - model.deleteAll() - } + Button("Delete All", role: .destructive) { + model.deleteAll() } } } diff --git a/DuckDuckGo/HomeMessageView.swift b/DuckDuckGo/HomeMessageView.swift index 3eacf7696d..51f500fd1c 100644 --- a/DuckDuckGo/HomeMessageView.swift +++ b/DuckDuckGo/HomeMessageView.swift @@ -144,7 +144,7 @@ struct HomeMessageView: View { @ViewBuilder private var subtitle: some View { - if #available(iOS 15, *), let attributed = try? AttributedString(markdown: viewModel.subtitle) { + if let attributed = try? AttributedString(markdown: viewModel.subtitle) { Text(attributed) .daxBodyRegular() } else { diff --git a/DuckDuckGo/ImportPasswordsViewModel.swift b/DuckDuckGo/ImportPasswordsViewModel.swift index 3f06429eae..480eb27ef4 100644 --- a/DuckDuckGo/ImportPasswordsViewModel.swift +++ b/DuckDuckGo/ImportPasswordsViewModel.swift @@ -140,7 +140,6 @@ private extension String { } -@available(iOS 15, *) private extension AttributedString { mutating func applyFontStyle(forSubstring substring: String, withFont font: Font) { diff --git a/DuckDuckGo/MainViewController+KeyCommands.swift b/DuckDuckGo/MainViewController+KeyCommands.swift index 695be22846..45f499a9b6 100644 --- a/DuckDuckGo/MainViewController+KeyCommands.swift +++ b/DuckDuckGo/MainViewController+KeyCommands.swift @@ -111,10 +111,8 @@ extension MainViewController { ] let commands = [alwaysAvailable, browsingCommands, findInPageCommands, arrowKeys, other].flatMap { $0 } - if #available(iOS 15, *) { - commands.forEach { - $0.wantsPriorityOverSystemBehavior = true - } + commands.forEach { + $0.wantsPriorityOverSystemBehavior = true } return commands } diff --git a/DuckDuckGo/NetworkProtectionDNSSettingsView.swift b/DuckDuckGo/NetworkProtectionDNSSettingsView.swift index cc6c1902fc..dae30832d9 100644 --- a/DuckDuckGo/NetworkProtectionDNSSettingsView.swift +++ b/DuckDuckGo/NetworkProtectionDNSSettingsView.swift @@ -109,7 +109,6 @@ struct NetworkProtectionDNSSettingsView: View { } } -@available(iOS 15, *) private struct ChecklistItem: View where Content: View { let isSelected: Bool let action: () -> Void diff --git a/DuckDuckGo/NetworkProtectionRootView.swift b/DuckDuckGo/NetworkProtectionRootView.swift index bdad605a52..22b4a22097 100644 --- a/DuckDuckGo/NetworkProtectionRootView.swift +++ b/DuckDuckGo/NetworkProtectionRootView.swift @@ -23,7 +23,6 @@ import SwiftUI import NetworkProtection import Subscription -@available(iOS 15, *) struct NetworkProtectionRootView: View { let statusViewModel: NetworkProtectionStatusViewModel diff --git a/DuckDuckGo/NetworkProtectionRootViewController.swift b/DuckDuckGo/NetworkProtectionRootViewController.swift index 013f6132bc..3dd569fccc 100644 --- a/DuckDuckGo/NetworkProtectionRootViewController.swift +++ b/DuckDuckGo/NetworkProtectionRootViewController.swift @@ -21,7 +21,6 @@ import SwiftUI -@available(iOS 15, *) final class NetworkProtectionRootViewController: UIHostingController { init() { @@ -40,7 +39,6 @@ final class NetworkProtectionRootViewController: UIHostingController Void @@ -145,7 +143,6 @@ private struct CountryItem: View { } } -@available(iOS 15, *) private struct ChecklistItem: View where Content: View { let isSelected: Bool let action: () -> Void @@ -170,7 +167,6 @@ private struct ChecklistItem: View where Content: View { } } -@available(iOS 15, *) private struct MenuItem: View { let isSelected: Bool let title: String diff --git a/DuckDuckGo/NetworkProtectionVPNSettingsView.swift b/DuckDuckGo/NetworkProtectionVPNSettingsView.swift index 06a265e736..dad117cf16 100644 --- a/DuckDuckGo/NetworkProtectionVPNSettingsView.swift +++ b/DuckDuckGo/NetworkProtectionVPNSettingsView.swift @@ -22,7 +22,6 @@ import SwiftUI import DesignResourcesKit -@available(iOS 15, *) struct NetworkProtectionVPNSettingsView: View { @StateObject var viewModel = NetworkProtectionVPNSettingsViewModel() diff --git a/DuckDuckGo/SettingsLegacyViewProvider.swift b/DuckDuckGo/SettingsLegacyViewProvider.swift index 8fefd7ea99..9ebab1a8f3 100644 --- a/DuckDuckGo/SettingsLegacyViewProvider.swift +++ b/DuckDuckGo/SettingsLegacyViewProvider.swift @@ -81,8 +81,6 @@ class SettingsLegacyViewProvider: ObservableObject { var autoclearData: UIViewController { instantiate("AutoClearSettingsViewController", fromStoryboard: "Settings") } var keyboard: UIViewController { instantiate("Keyboard", fromStoryboard: "Settings") } var feedback: UIViewController { instantiate("Feedback", fromStoryboard: "Feedback") } - - @available(iOS 15, *) var netP: UIViewController { NetworkProtectionRootViewController() } @MainActor diff --git a/DuckDuckGo/SettingsViewModel.swift b/DuckDuckGo/SettingsViewModel.swift index d8c216267a..5003ec40e9 100644 --- a/DuckDuckGo/SettingsViewModel.swift +++ b/DuckDuckGo/SettingsViewModel.swift @@ -597,10 +597,8 @@ extension SettingsViewModel { #if NETWORK_PROTECTION case .netP: - if #available(iOS 15, *) { - firePixel(.privacyProVPNSettings) - pushViewController(legacyViewProvider.netP) - } + firePixel(.privacyProVPNSettings) + pushViewController(legacyViewProvider.netP) #endif } } diff --git a/DuckDuckGo/SpeechRecognizer.swift b/DuckDuckGo/SpeechRecognizer.swift index d5824d80a8..67e58d9377 100644 --- a/DuckDuckGo/SpeechRecognizer.swift +++ b/DuckDuckGo/SpeechRecognizer.swift @@ -98,8 +98,6 @@ final class SpeechRecognizer: NSObject, SpeechRecognizerProtocol { return normalized } - // https://app.asana.com/0/1201011656765697/1201271104639596 - @available(iOS 15, *) func startRecording(resultHandler: @escaping (_ text: String?, _ error: Error?, _ speechDidFinish: Bool) -> Void, diff --git a/DuckDuckGo/SpeechRecognizerProtocol.swift b/DuckDuckGo/SpeechRecognizerProtocol.swift index 7506c1fad3..369d3ccede 100644 --- a/DuckDuckGo/SpeechRecognizerProtocol.swift +++ b/DuckDuckGo/SpeechRecognizerProtocol.swift @@ -25,7 +25,6 @@ protocol SpeechRecognizerProtocol { func getVolumeLevel(from channelData: UnsafeMutablePointer) -> Float func stopRecording() - @available(iOS 15, *) func startRecording(resultHandler: @escaping (_ text: String?, _ error: Error?, _ speechDidFinish: Bool) -> Void, diff --git a/DuckDuckGo/Subscription/Views/SubscriptionEmailView.swift b/DuckDuckGo/Subscription/Views/SubscriptionEmailView.swift index 86d628ae53..0b43465f61 100644 --- a/DuckDuckGo/Subscription/Views/SubscriptionEmailView.swift +++ b/DuckDuckGo/Subscription/Views/SubscriptionEmailView.swift @@ -182,7 +182,6 @@ struct SubscriptionEmailView: View { } // Commented out because CI fails if a SwiftUI preview is enabled https://app.asana.com/0/414709148257752/1206774081310425/f -// @available(iOS 15.0, *) // struct SubscriptionEmailView_Previews: PreviewProvider { // static var previews: some View { // SubscriptionEmailView() diff --git a/DuckDuckGo/Subscription/Views/SubscriptionFlowView.swift b/DuckDuckGo/Subscription/Views/SubscriptionFlowView.swift index b6252634a9..8cbedebb2a 100644 --- a/DuckDuckGo/Subscription/Views/SubscriptionFlowView.swift +++ b/DuckDuckGo/Subscription/Views/SubscriptionFlowView.swift @@ -246,7 +246,6 @@ struct SubscriptionFlowView: View { } // Commented out because CI fails if a SwiftUI preview is enabled https://app.asana.com/0/414709148257752/1206774081310425/f -// @available(iOS 15.0, *) // struct SubscriptionFlowView_Previews: PreviewProvider { // static var previews: some View { // SubscriptionFlowView() diff --git a/DuckDuckGo/Subscription/Views/SubscriptionITPView.swift b/DuckDuckGo/Subscription/Views/SubscriptionITPView.swift index 135d467e91..29ff072a6c 100644 --- a/DuckDuckGo/Subscription/Views/SubscriptionITPView.swift +++ b/DuckDuckGo/Subscription/Views/SubscriptionITPView.swift @@ -141,7 +141,6 @@ struct SubscriptionITPView: View { } // Commented out because CI fails if a SwiftUI preview is enabled https://app.asana.com/0/414709148257752/1206774081310425/f -// @available(iOS 15.0, *) // struct SubscriptionITPView_Previews: PreviewProvider { // static var previews: some View { // SubscriptionITPView() diff --git a/DuckDuckGo/Subscription/Views/SubscriptionPIRView.swift b/DuckDuckGo/Subscription/Views/SubscriptionPIRView.swift index c6d85302fc..7947d697e1 100644 --- a/DuckDuckGo/Subscription/Views/SubscriptionPIRView.swift +++ b/DuckDuckGo/Subscription/Views/SubscriptionPIRView.swift @@ -180,7 +180,6 @@ struct SubscriptionPIRView: View { } // Commented out because CI fails if a SwiftUI preview is enabled https://app.asana.com/0/414709148257752/1206774081310425/f -// @available(iOS 15.0, *) // struct SubscriptionPIRView_Previews: PreviewProvider { // static var previews: some View { // SubscriptionPIRView() diff --git a/DuckDuckGo/Subscription/Views/SubscriptionSettingsView.swift b/DuckDuckGo/Subscription/Views/SubscriptionSettingsView.swift index 48f35eafba..6462f25c3f 100644 --- a/DuckDuckGo/Subscription/Views/SubscriptionSettingsView.swift +++ b/DuckDuckGo/Subscription/Views/SubscriptionSettingsView.swift @@ -318,7 +318,6 @@ struct SubscriptionSettingsView: View { } // Commented out because CI fails if a SwiftUI preview is enabled https://app.asana.com/0/414709148257752/1206774081310425/f -// @available(iOS 15.0, *) // struct SubscriptionSettingsView_Previews: PreviewProvider { // static var previews: some View { // SubscriptionSettingsView() diff --git a/DuckDuckGo/VoiceSearchFeedbackView.swift b/DuckDuckGo/VoiceSearchFeedbackView.swift index 0f275231d1..3e90eeda66 100644 --- a/DuckDuckGo/VoiceSearchFeedbackView.swift +++ b/DuckDuckGo/VoiceSearchFeedbackView.swift @@ -29,9 +29,7 @@ struct VoiceSearchFeedbackView: View { voiceFeedbackView } .onAppear { - if #available(iOS 15, *) { - speechModel.startSpeechRecognizer() - } + speechModel.startSpeechRecognizer() speechModel.startSilenceAnimation() }.onDisappear { speechModel.stopSpeechRecognizer() diff --git a/DuckDuckGo/VoiceSearchFeedbackViewModel.swift b/DuckDuckGo/VoiceSearchFeedbackViewModel.swift index 0b1499103d..f83b6c69f7 100644 --- a/DuckDuckGo/VoiceSearchFeedbackViewModel.swift +++ b/DuckDuckGo/VoiceSearchFeedbackViewModel.swift @@ -57,7 +57,6 @@ class VoiceSearchFeedbackViewModel: ObservableObject { self.speechRecognizer = speechRecognizer } - @available(iOS 15, *) func startSpeechRecognizer() { speechRecognizer.startRecording { [weak self] text, error, speechDidFinish in DispatchQueue.main.async { diff --git a/DuckDuckGoTests/AnimatableTypingTextModelTests.swift b/DuckDuckGoTests/AnimatableTypingTextModelTests.swift index dffcef4898..7da4544530 100644 --- a/DuckDuckGoTests/AnimatableTypingTextModelTests.swift +++ b/DuckDuckGoTests/AnimatableTypingTextModelTests.swift @@ -69,10 +69,6 @@ final class AnimatableTypingTextModelTests: XCTestCase { } func testWhenTimerFiresThenTypedTextIsPublished_iOS15() throws { - guard #available(iOS 15, *) else { - throw XCTSkip("Test available only on iOS 15*") - } - // GIVEN let text = "Hello World!!!" var typedText: NSAttributedString = .init(string: "") @@ -97,10 +93,6 @@ final class AnimatableTypingTextModelTests: XCTestCase { } func testWhenStopAnimatingIsCalledThenWholeTextIsPublished_iOS15() throws { - guard #available(iOS 15, *) else { - throw XCTSkip("Test available only on iOS 15*") - } - // GIVEN let text = "Hello World!!!" var typedText: NSAttributedString = .init(string: "") diff --git a/LocalPackages/SyncUI/Sources/SyncUI/Views/PasteCodeView.swift b/LocalPackages/SyncUI/Sources/SyncUI/Views/PasteCodeView.swift index 8353b1ba06..78b78167fc 100644 --- a/LocalPackages/SyncUI/Sources/SyncUI/Views/PasteCodeView.swift +++ b/LocalPackages/SyncUI/Sources/SyncUI/Views/PasteCodeView.swift @@ -96,7 +96,6 @@ public struct PasteCodeView: View { .padding() } - @available(iOS 15, *) var instructionsString: AttributedString { let baseString = UserText.manuallyEnterCodeInstructionAttributed(syncMenuPath: UserText.syncMenuPath, menuItem: UserText.viewTextCodeMenuItem) var instructions = AttributedString(baseString) diff --git a/LocalPackages/SyncUI/Sources/SyncUI/Views/ScanOrPasteCodeView.swift b/LocalPackages/SyncUI/Sources/SyncUI/Views/ScanOrPasteCodeView.swift index d0c2cc0add..2d16003406 100644 --- a/LocalPackages/SyncUI/Sources/SyncUI/Views/ScanOrPasteCodeView.swift +++ b/LocalPackages/SyncUI/Sources/SyncUI/Views/ScanOrPasteCodeView.swift @@ -74,7 +74,6 @@ public struct ScanOrSeeCode: View { return Text(instructionsString) } - @available(iOS 15, *) var instructionsString: AttributedString { let baseString = UserText.scanOrSeeCodeInstructionAttributed(syncMenuPath: UserText.syncMenuPath) var instructions = AttributedString(baseString)