diff --git a/AlphaWallet/AddMultipleCustomRpc/AddMultipleCustomRpcView.swift b/AlphaWallet/AddMultipleCustomRpc/AddMultipleCustomRpcView.swift index 764a9be84..c797ba95a 100644 --- a/AlphaWallet/AddMultipleCustomRpc/AddMultipleCustomRpcView.swift +++ b/AlphaWallet/AddMultipleCustomRpc/AddMultipleCustomRpcView.swift @@ -28,11 +28,7 @@ class AddMultipleCustomRpcView: UIView { private lazy var activityIndicatorView: UIActivityIndicatorView = { let view: UIActivityIndicatorView - if #available(iOS 13.0, *) { - view = UIActivityIndicatorView(style: .medium) - } else { - view = UIActivityIndicatorView(style: .white) - } + view = UIActivityIndicatorView(style: .medium) view.translatesAutoresizingMaskIntoConstraints = false view.hidesWhenStopped = false return view diff --git a/AlphaWallet/AppCoordinator.swift b/AlphaWallet/AppCoordinator.swift index 3464a162f..2880dc0c5 100644 --- a/AlphaWallet/AppCoordinator.swift +++ b/AlphaWallet/AppCoordinator.swift @@ -299,7 +299,6 @@ class AppCoordinator: NSObject, Coordinator { } func handleIntent(userActivity: NSUserActivity) -> Bool { - guard #available(iOS 12.0, *) else { return false } if let type = userActivity.userInfo?[WalletQrCodeDonation.userInfoType.key] as? String, type == WalletQrCodeDonation.userInfoType.value { analyticsService.log(navigation: Analytics.Navigation.openShortcut, properties: [ Analytics.Properties.type.rawValue: Analytics.ShortcutType.walletQrCode.rawValue diff --git a/AlphaWallet/Core/Device.swift b/AlphaWallet/Core/Device.swift index eec36c90d..29bc29384 100644 --- a/AlphaWallet/Core/Device.swift +++ b/AlphaWallet/Core/Device.swift @@ -232,8 +232,6 @@ extension UIDevice { } static public var isSafeAreaDevice: Bool { - // above iOS11 dont have safe area - guard #available(iOS 11.0, *) else { return false } guard let safeAreaInsets = UIApplication.shared.firstKeyWindow?.safeAreaInsets else { return false } diff --git a/AlphaWallet/Core/SwapToken/HoneySwap/HoneySwap.swift b/AlphaWallet/Core/SwapToken/HoneySwap/HoneySwap.swift index d4db3fbd7..452be34c0 100644 --- a/AlphaWallet/Core/SwapToken/HoneySwap/HoneySwap.swift +++ b/AlphaWallet/Core/SwapToken/HoneySwap/HoneySwap.swift @@ -105,14 +105,10 @@ class HoneySwap: TokenActionsProvider, SwapTokenURLProviderType { extension UITraitCollection { var honeyswapTheme: HoneySwap.Theme { - if #available(iOS 12.0, *) { - switch userInterfaceStyle { - case .dark: - return .dark - case .light, .unspecified: - return .light - } - } else { + switch userInterfaceStyle { + case .dark: + return .dark + case .light, .unspecified: return .light } } diff --git a/AlphaWallet/Core/SwapToken/Uniswap/Uniswap.swift b/AlphaWallet/Core/SwapToken/Uniswap/Uniswap.swift index 98d18b8fb..d62cef678 100644 --- a/AlphaWallet/Core/SwapToken/Uniswap/Uniswap.swift +++ b/AlphaWallet/Core/SwapToken/Uniswap/Uniswap.swift @@ -112,14 +112,10 @@ struct Uniswap: TokenActionsProvider, SwapTokenURLProviderType { extension UITraitCollection { var uniswapTheme: Uniswap.Theme { - if #available(iOS 12.0, *) { - switch userInterfaceStyle { - case .dark: - return .dark - case .light, .unspecified: - return .light - } - } else { + switch userInterfaceStyle { + case .dark: + return .dark + case .light, .unspecified: return .light } } diff --git a/AlphaWallet/Donations/WalletQrCodeDonation.swift b/AlphaWallet/Donations/WalletQrCodeDonation.swift index 38467c0aa..39fdf1547 100644 --- a/AlphaWallet/Donations/WalletQrCodeDonation.swift +++ b/AlphaWallet/Donations/WalletQrCodeDonation.swift @@ -27,7 +27,6 @@ class WalletQrCodeDonation { } func donate() { - guard #available(iOS 12.0, *) else { return } let activity = NSUserActivity(activityType: Self.activityType) activity.title = R.string.localizable.donateShortcutsWalletQrCode() let walletKey = "wallet" @@ -41,11 +40,10 @@ class WalletQrCodeDonation { } func delete() { - guard #available(iOS 12.0, *) else { return } info("Deleting donated shortcut: \(Self.persistentIdentifier)…") CSSearchableIndex.default().deleteSearchableItems(withDomainIdentifiers: [Self.persistentIdentifier]) NSUserActivity.deleteSavedUserActivities(withPersistentIdentifiers: [Self.persistentIdentifier]) { info("Deleted donated shortcut: \(Self.persistentIdentifier)") } } -} \ No newline at end of file +} diff --git a/AlphaWallet/Rpc Network/AvailableRpcNetwork.swift b/AlphaWallet/Rpc Network/AvailableRpcNetwork.swift index 52027dd28..ea4dd5d3a 100644 --- a/AlphaWallet/Rpc Network/AvailableRpcNetwork.swift +++ b/AlphaWallet/Rpc Network/AvailableRpcNetwork.swift @@ -81,12 +81,8 @@ fileprivate func readFileIntoMemory(url: URL) -> Data? { fileprivate func uncompressData(data: Data) -> Data? { do { - if #available(iOS 13.0, *) { - let uncompressedData = try (data as NSData).decompressed(using: selectedCompressionAlgorithm) - return uncompressedData as Data - } else { - return nil - } + let uncompressedData = try (data as NSData).decompressed(using: selectedCompressionAlgorithm) + return uncompressedData as Data } catch { return nil } diff --git a/AlphaWallet/Style/AppStyle.swift b/AlphaWallet/Style/AppStyle.swift index 16f1bad61..754c38e99 100644 --- a/AlphaWallet/Style/AppStyle.swift +++ b/AlphaWallet/Style/AppStyle.swift @@ -377,11 +377,7 @@ enum Style { enum TabBar { enum Background { static let color: UIColor = { - if #available(iOS 13.0, *) { - return UIColor.systemBackground - } else { - return R.color.white()! - } + return UIColor.systemBackground }() } enum Separator { diff --git a/AlphaWallet/TokenScriptClient/Coordinators/EventSourceCoordinator.swift b/AlphaWallet/TokenScriptClient/Coordinators/EventSourceCoordinator.swift index 8385fab2a..657d3b34c 100644 --- a/AlphaWallet/TokenScriptClient/Coordinators/EventSourceCoordinator.swift +++ b/AlphaWallet/TokenScriptClient/Coordinators/EventSourceCoordinator.swift @@ -18,7 +18,7 @@ extension PromiseKit.Result { protocol EventSourceCoordinatorType: class { func fetchEthereumEvents() - func fetchEventsByTokenId(forToken token: TokenObject) -> [Promise] + @discardableResult func fetchEventsByTokenId(forToken token: TokenObject) -> [Promise] } //TODO rename this generic name to reflect that it's for event instances, not for event activity diff --git a/AlphaWallet/Tokens/Collectibles/Views/AssetsPageView.swift b/AlphaWallet/Tokens/Collectibles/Views/AssetsPageView.swift index 158048982..c000a02ac 100644 --- a/AlphaWallet/Tokens/Collectibles/Views/AssetsPageView.swift +++ b/AlphaWallet/Tokens/Collectibles/Views/AssetsPageView.swift @@ -188,12 +188,7 @@ extension AssetsPageView: StatefulViewController { extension UICollectionViewLayout { static func createGridLayout(spacing: CGFloat = 16, heightDimension: CGFloat = 220) -> UICollectionViewLayout { let layout = UICollectionViewCompositionalLayout { _, _ -> NSCollectionLayoutSection? in - let iosVersionRelatedFractionalWidthForGrid: CGFloat - if #available(iOS 13.0, *) { - iosVersionRelatedFractionalWidthForGrid = 1.0 - } else { - iosVersionRelatedFractionalWidthForGrid = 0.92 - } + let iosVersionRelatedFractionalWidthForGrid: CGFloat = 1.0 let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(1.0)) let item = NSCollectionLayoutItem(layoutSize: itemSize)