Skip to content

Commit

Permalink
Reformat code for all swift files in project
Browse files Browse the repository at this point in the history
  • Loading branch information
ealymbaev committed Nov 28, 2023
1 parent 7bd15cf commit b4ea65e
Show file tree
Hide file tree
Showing 1,145 changed files with 14,206 additions and 17,308 deletions.
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.8
2 changes: 1 addition & 1 deletion UnstoppableWallet/IntentExtension/IntentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ class IntentHandler: INExtension, SingleCoinPriceIntentHandling {
// This is the default implementation. If you want different objects to handle different intents,
// you can override this and return the handler you want for that particular intent.

return self
self
}
}
30 changes: 14 additions & 16 deletions UnstoppableWallet/UnstoppableWallet/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import UIKit
import ThemeKit
import UIKit

@UIApplicationMain
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

private var backgroundTask: UIBackgroundTaskIdentifier = UIBackgroundTaskIdentifier.invalid
private var backgroundTask: UIBackgroundTaskIdentifier = .invalid

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Theme.updateNavigationBarTheme()

window = ThemeWindow(frame: UIScreen.main.bounds)
Expand All @@ -24,15 +24,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return true
}

func applicationWillResignActive(_ application: UIApplication) {
func applicationWillResignActive(_: UIApplication) {
App.instance?.appManager.willResignActive()
}

func applicationDidBecomeActive(_ application: UIApplication) {
func applicationDidBecomeActive(_: UIApplication) {
App.instance?.appManager.didBecomeActive()
}

func applicationDidEnterBackground(_ application: UIApplication) {
func applicationDidEnterBackground(_: UIApplication) {
App.instance?.appManager.didEnterBackground()

backgroundTask = UIApplication.shared.beginBackgroundTask {
Expand All @@ -41,7 +41,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
}

func applicationWillEnterForeground(_ application: UIApplication) {
func applicationWillEnterForeground(_: UIApplication) {
App.instance?.appManager.willEnterForeground()

if backgroundTask != UIBackgroundTaskIdentifier.invalid {
Expand All @@ -50,31 +50,29 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
}

func applicationWillTerminate(_ application: UIApplication) {
func applicationWillTerminate(_: UIApplication) {
App.instance?.appManager.willTerminate()
}

func application(_ application: UIApplication, shouldAllowExtensionPointIdentifier extensionPointIdentifier: UIApplication.ExtensionPointIdentifier) -> Bool {
func application(_: UIApplication, shouldAllowExtensionPointIdentifier extensionPointIdentifier: UIApplication.ExtensionPointIdentifier) -> Bool {
if extensionPointIdentifier == .keyboard {
//disable custom keyboards
// disable custom keyboards
return false
}
return true
}

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
}
func application(_: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken _: Data) {}

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any]) -> Bool {
func application(_: UIApplication, open url: URL, options _: [UIApplication.OpenURLOptionsKey: Any]) -> Bool {
App.instance?.appManager.didReceive(url: url) ?? false
}

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> ()) -> Bool {
func application(_: UIApplication, continue userActivity: NSUserActivity, restorationHandler _: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
if userActivity.activityType == NSUserActivityTypeBrowsingWeb, let url = userActivity.webpageURL {
return App.instance?.appManager.didReceive(url: url) ?? false
}

return false
}

}
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
import Foundation
import BinanceChainKit
import Combine
import RxSwift
import Foundation
import HsExtensions
import BinanceChainKit

extension BinanceChainKit {
import RxSwift

struct DisposedError: Error {}
public extension BinanceChainKit {
internal struct DisposedError: Error {}

public var lastBlockHeightObservable: Observable<Int?> {
var lastBlockHeightObservable: Observable<Int?> {
$lastBlockHeight.asObservable()
}

public var syncStateObservable: Observable<SyncState> {
var syncStateObservable: Observable<SyncState> {
$syncState.asObservable()
}

public func transactionsSingle(symbol: String, filterType: TransactionFilterType? = nil, fromTransactionHash: String? = nil, limit: Int? = nil) -> Single<[TransactionInfo]> {
func transactionsSingle(symbol: String, filterType: TransactionFilterType? = nil, fromTransactionHash: String? = nil, limit: Int? = nil) -> Single<[TransactionInfo]> {
Single.just(transactions(symbol: symbol, filterType: filterType, fromTransactionHash: fromTransactionHash, limit: limit))
}

public func sendSingle(symbol: String, to: String, amount: Decimal, memo: String) -> Single<String> {
func sendSingle(symbol: String, to: String, amount: Decimal, memo: String) -> Single<String> {
Single<String>.create { [weak self] observer in
guard let strongSelf = self else {
observer(.error(DisposedError()))
Expand All @@ -42,7 +41,7 @@ extension BinanceChainKit {
}
}

public func moveToBSCSingle(symbol: String, amount: Decimal) -> Single<String> {
func moveToBSCSingle(symbol: String, amount: Decimal) -> Single<String> {
Single<String>.create { [weak self] observer in
guard let strongSelf = self else {
observer(.error(DisposedError()))
Expand All @@ -63,17 +62,14 @@ extension BinanceChainKit {
}
}
}

}

extension Asset {

public var balanceObservable: Observable<Decimal> {
public extension Asset {
var balanceObservable: Observable<Decimal> {
$balance.asObservable()
}

public func transactionsObservable(filterType: TransactionFilterType? = nil) -> Observable<[TransactionInfo]> {
func transactionsObservable(filterType: TransactionFilterType? = nil) -> Observable<[TransactionInfo]> {
transactionsPublisher(filterType: filterType).asObservable()
}

}
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import Foundation
import Combine
import RxSwift
import BigInt
import Combine
import Eip20Kit
import EvmKit
import Foundation
import HsToolKit
import Eip20Kit
import RxSwift

extension Eip20Kit.Kit {
struct DisposedError: Error {}
public extension Eip20Kit.Kit {
internal struct DisposedError: Error {}

public func transactionsSingle(from hash: Data?, limit: Int?) throws -> Single<[FullTransaction]> {
func transactionsSingle(from hash: Data?, limit: Int?) throws -> Single<[FullTransaction]> {
Single.just(transactions(from: hash, limit: limit))
}

public var syncStateObservable: Observable<SyncState> {
var syncStateObservable: Observable<SyncState> {
syncStatePublisher.asObservable()
}

public var transactionsSyncStateObservable: Observable<SyncState> {
var transactionsSyncStateObservable: Observable<SyncState> {
transactionsSyncStatePublisher.asObservable()
}

public var balanceObservable: Observable<BigUInt> {
var balanceObservable: Observable<BigUInt> {
balancePublisher.asObservable()
}

public var transactionsObservable: Observable<[FullTransaction]> {
var transactionsObservable: Observable<[FullTransaction]> {
transactionsPublisher.asObservable()
}

public func allowanceSingle(spenderAddress: EvmKit.Address, defaultBlockParameter: DefaultBlockParameter = .latest) -> Single<String> {
func allowanceSingle(spenderAddress: EvmKit.Address, defaultBlockParameter: DefaultBlockParameter = .latest) -> Single<String> {
Single<String>.create { [weak self] observer in
guard let strongSelf = self else {
observer(.error(DisposedError()))
Expand All @@ -51,7 +51,7 @@ extension Eip20Kit.Kit {
}
}

public static func tokenInfoSingle(networkManager: NetworkManager, rpcSource: RpcSource, contractAddress: EvmKit.Address) -> Single<TokenInfo> {
static func tokenInfoSingle(networkManager: NetworkManager, rpcSource: RpcSource, contractAddress: EvmKit.Address) -> Single<TokenInfo> {
Single<TokenInfo>.create { observer in
let task = Task {
do {
Expand All @@ -67,5 +67,4 @@ extension Eip20Kit.Kit {
}
}
}

}
Loading

0 comments on commit b4ea65e

Please sign in to comment.