Merge pull request #3804 from oa-s/#3761

Remove all checks for iOS13 in code #3761
pull/3808/head
Crypto Pank 3 years ago committed by GitHub
commit 8eb29114e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      AlphaWallet/AddMultipleCustomRpc/AddMultipleCustomRpcView.swift
  2. 1
      AlphaWallet/AppCoordinator.swift
  3. 2
      AlphaWallet/Core/Device.swift
  4. 12
      AlphaWallet/Core/SwapToken/HoneySwap/HoneySwap.swift
  5. 12
      AlphaWallet/Core/SwapToken/Uniswap/Uniswap.swift
  6. 4
      AlphaWallet/Donations/WalletQrCodeDonation.swift
  7. 8
      AlphaWallet/Rpc Network/AvailableRpcNetwork.swift
  8. 6
      AlphaWallet/Style/AppStyle.swift
  9. 2
      AlphaWallet/TokenScriptClient/Coordinators/EventSourceCoordinator.swift
  10. 7
      AlphaWallet/Tokens/Collectibles/Views/AssetsPageView.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

@ -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

@ -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
}

@ -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
}
}

@ -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
}
}

@ -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)")
}
}
}
}

@ -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
}

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

@ -18,7 +18,7 @@ extension PromiseKit.Result {
protocol EventSourceCoordinatorType: class {
func fetchEthereumEvents()
func fetchEventsByTokenId(forToken token: TokenObject) -> [Promise<Void>]
@discardableResult func fetchEventsByTokenId(forToken token: TokenObject) -> [Promise<Void>]
}
//TODO rename this generic name to reflect that it's for event instances, not for event activity

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

Loading…
Cancel
Save