Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS-7578: Fix project warnings #3633

Merged
merged 19 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ end
def blockchain_sdk_pods
# 'TangemWalletCore' dependency must be added via SPM

pod 'BlockchainSdk', :git => 'https://github.com/tangem/blockchain-sdk-swift.git', :tag => 'develop-676'
pod 'BlockchainSdk', :git => 'https://github.com/tangem/blockchain-sdk-swift.git', :tag => 'develop-677'
#pod 'BlockchainSdk', :path => '../blockchain-sdk-swift'

pod 'Solana.Swift', :git => 'https://github.com/tangem/Solana.Swift', :tag => '1.2.0-tangem11'
Expand Down
10 changes: 5 additions & 5 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ DEPENDENCIES:
- AmplitudeSwift (= 1.6.2)
- BinanceChain (from `https://github.com/tangem/swiftbinancechain.git`, tag `0.0.11`)
- BitcoinCore.swift (from `https://github.com/tangem/bitcoincore.git`, tag `0.0.20`)
- BlockchainSdk (from `https://github.com/tangem/blockchain-sdk-swift.git`, tag `develop-676`)
- BlockchainSdk (from `https://github.com/tangem/blockchain-sdk-swift.git`, tag `develop-677`)
- BlockiesSwift (~> 0.1.2)
- CombineExt (~> 1.8.0)
- Firebase/Analytics (= 10.29.0)
Expand Down Expand Up @@ -278,7 +278,7 @@ EXTERNAL SOURCES:
:tag: 0.0.20
BlockchainSdk:
:git: https://github.com/tangem/blockchain-sdk-swift.git
:tag: develop-676
:tag: develop-677
Solana.Swift:
:git: https://github.com/tangem/Solana.Swift
:tag: 1.2.0-tangem11
Expand All @@ -301,7 +301,7 @@ CHECKOUT OPTIONS:
:tag: 0.0.20
BlockchainSdk:
:git: https://github.com/tangem/blockchain-sdk-swift.git
:tag: develop-676
:tag: develop-677
Solana.Swift:
:git: https://github.com/tangem/Solana.Swift
:tag: 1.2.0-tangem11
Expand All @@ -322,7 +322,7 @@ SPEC CHECKSUMS:
AnyCodable-FlightSchool: 261cbe76757802b17d471b9059b21e6fa5edf57b
BinanceChain: f727abc7a20ba71f4497e46b7400124027b25692
BitcoinCore.swift: 64ac4e69d9a6ef917bcbb0c23f1324cf57a822fb
BlockchainSdk: f82a751d6216f50a7f085cf5906e919ed3e923e5
BlockchainSdk: b744a57e39d5b5e76c8ecfaa8feb41753f9fa7df
BlockiesSwift: 22d8d56dd187e6bfd16cb8c8fbd4fd4896c3e65d
CombineExt: c4daa97ef75754d8ef319bd79edeef82652f3eea
Firebase: cec914dab6fd7b1bd8ab56ea07ce4e03dd251c2d
Expand Down Expand Up @@ -354,6 +354,6 @@ SPEC CHECKSUMS:
TangemSdk: 4a188873f9dbed6340cca9ad6a010240af6df432
WalletConnectSwiftV2: 5ea47db4d86e39fc749b66a05a661af9e87b277d

PODFILE CHECKSUM: 724ef0c4be0515bd3e9a44434a3a9d95e0366cc8
PODFILE CHECKSUM: 2d3aa3f0162fb7783e863e0db0a28bde6f023bda

COCOAPODS: 1.15.2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// TokenMarketsHistoryChartMapper.swift
// Tangem
//
// Created by m3g0byt3 on 29.07.2024.
// Created by Andrey Fedorov on 29.07.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CommonDerivationManager {
private var bag = Set<AnyCancellable>()
private let pendingDerivations: CurrentValueSubject<[Data: [DerivationPath]], Never> = .init([:])

internal init(keysRepository: KeysRepository, userTokenListManager: UserTokenListManager) {
init(keysRepository: KeysRepository, userTokenListManager: UserTokenListManager) {
self.keysRepository = keysRepository
self.userTokenListManager = userTokenListManager
bind()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// CommonPushNotificationsInteractor.swift
// Tangem
//
// Created by m3g0byt3 on 26.06.2024.
// Created by Andrey Fedorov on 26.06.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// PushNotificationsAvailabilityProvider.swift
// Tangem
//
// Created by m3g0byt3 on 27.06.2024.
// Created by Andrey Fedorov on 27.06.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// PushNotificationsHelpersFactory.swift
// Tangem
//
// Created by m3g0byt3 on 27.06.2024.
// Created by Andrey Fedorov on 27.06.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// PushNotificationsInteractor.swift
// Tangem
//
// Created by m3g0byt3 on 01.07.2024.
// Created by Andrey Fedorov on 01.07.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// PushNotificationsPermissionManager.swift
// Tangem
//
// Created by m3g0byt3 on 27.06.2024.
// Created by Andrey Fedorov on 27.06.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// PushNotificationsPermissionRequestFlow.swift
// Tangem
//
// Created by m3g0byt3 on 01.07.2024.
// Created by Andrey Fedorov on 01.07.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// PushNotificationsService.swift
// Tangem
//
// Created by m3g0byt3 on 26.06.2024.
// Created by Andrey Fedorov on 26.06.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ final class WalletConnectV2Service {

do {
log("Namespaces to approve for session connection: \(namespaces)")
try await signApi.approve(proposalId: id, namespaces: namespaces)
_ = try await signApi.approve(proposalId: id, namespaces: namespaces)
} catch let error as WalletConnectV2Error {
self.displayErrorUI(error)
} catch {
Expand Down
2 changes: 1 addition & 1 deletion Tangem/Common/AppConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ enum AppConstants {
static var webShopUrl: URL {
var urlComponents = URLComponents(string: "https://buy.tangem.com")!

var queryItemsDict = [
let queryItemsDict = [
"utm_source": "tangem",
"utm_medium": "app",
"app_instance_id": FirebaseAnalytics.Analytics.appInstanceID(),
Expand Down
2 changes: 1 addition & 1 deletion Tangem/Common/Extensions/UIKit/CGAffineTransform+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// CGAffineTransform+.swift
// Tangem
//
// Created by m3g0byt3 on 11.07.2024.
// Created by Andrey Fedorov on 11.07.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand Down
2 changes: 1 addition & 1 deletion Tangem/Common/Extensions/UIKit/CGPoint+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// CGPoint+.swift
// Tangem
//
// Created by m3g0byt3 on 11.07.2024.
// Created by Andrey Fedorov on 11.07.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// UIPanGestureRecognizer+.swift
// Tangem
//
// Created by m3g0byt3 on 15.07.2024.
// Created by Andrey Fedorov on 15.07.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand Down
2 changes: 1 addition & 1 deletion Tangem/Common/Extensions/UIKit/UIScrollView+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// UIScrollView+.swift
// Tangem
//
// Created by m3g0byt3 on 11.07.2024.
// Created by Andrey Fedorov on 11.07.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CommonCardInitializer {
private var cardInfo: CardInfo
private var cancellable: AnyCancellable?

internal init(tangemSdk: TangemSdk, cardInfo: CardInfo) {
init(tangemSdk: TangemSdk, cardInfo: CardInfo) {
self.tangemSdk = tangemSdk
self.cardInfo = cardInfo
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ class PendingBackupManager {

func onProceedBackup(_ card: Card) {
let cardInfo = CardInfo(card: CardDTO(card: card), walletData: .none, name: "")
let config = UserWalletConfigFactory(cardInfo).makeConfig()

let backupValidator = BackupValidator()

// clean card from existing pending backup
Expand Down
2 changes: 1 addition & 1 deletion Tangem/Common/UI/FeeRowView/FeeRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct FeeRowView: View {
.frame(width: 70, height: 15)
case .loaded(let components):
trailingView(for: components)
case .failedToLoad(let error):
case .failedToLoad:
Text(AppConstants.dashSign)
.style(leadingFont, color: Colors.Text.primary1)
.layoutPriority(1)
Expand Down
3 changes: 1 addition & 2 deletions Tangem/Common/UI/IconView/CachedAsyncImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public struct CachedAsyncImage<Content>: View where Content: View {

public var body: some View {
content(phase)
.task(id: urlRequest, load)
.task(id: urlRequest) { await load() }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

/// Loads and displays an image from the specified URL.
Expand Down Expand Up @@ -307,7 +307,6 @@ public struct CachedAsyncImage<Content>: View where Content: View {
}
}

@Sendable
private func load() async {
do {
if let urlRequest = urlRequest {
Expand Down

This file was deleted.

30 changes: 0 additions & 30 deletions Tangem/Common/UI/KeyboardAvoidance/UIResponder+Current.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Tangem/Modules/Details/DetailsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ extension DetailsViewModel {
}

func openSupportChat() {
guard let selectedUserWalletModel else {
guard selectedUserWalletModel != nil else {
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// PushNotificationsBottomSheetView.swift
// Tangem
//
// Created by m3g0byt3 on 05.07.2024.
// Created by Andrey Fedorov on 05.07.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,25 +234,7 @@ private struct TextInputWithTitle: View {
// MARK: - Preview

#Preview {
let userTokensManager: UserTokensManager = {
let fakeUserTokenListManager = FakeUserTokenListManager(walletManagers: [], isDelayed: false)
return FakeUserTokensManager(
derivationManager: FakeDerivationManager(pendingDerivationsCount: 5),
userTokenListManager: fakeUserTokenListManager
)
}()
let userWalletModel = FakeUserWalletModel.wallet3Cards
let config = userWalletModel.config

let viewModel = AddCustomTokenViewModel(
settings: .init(
supportedBlockchains: config.supportedBlockchains.asArray,
hdWalletsSupported: config.hasFeature(.hdWallets),
derivationStyle: config.derivationStyle
),
userWalletModel: userWalletModel,
coordinator: AddCustomTokenCoordinator()
)
let coordinator = AddCustomTokenCoordinator()
coordinator.start(with: .init(userWalletModel: userWalletModel))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,6 @@ extension MarketsTokenDetailsInsightsView {
}

#Preview {
let records: [MarketsTokenDetailsInsightsView.RecordInfo] = [
.init(type: .buyers, recordData: "0", trend: nil),
.init(type: .buyPressure, recordData: "-$400", trend: .negative),
.init(type: .holdersChange, recordData: "+100", trend: .positive),
.init(type: .liquidity, recordData: "+445,9K", trend: .positive),
]
let insights = CurrentValueSubject<TokenMarketsDetailsInsights?, Never>(nil)

return MarketsTokenDetailsInsightsView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ extension MarketsSkeletonItemView {
}

#Preview {
let tokens = DummyMarketTokenModelFactory().list()

return ScrollView(.vertical) {
ForEach(0 ..< 10) { _ in
MarketsSkeletonItemView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// OnboardingLayoutConstants.swift
// Tangem
//
// Created by m3g0byt3 on 05.07.2024.
// Created by Andrey Fedorov on 05.07.2024.
// Copyright © 2024 Tangem AG. All rights reserved.
//

Expand Down
2 changes: 1 addition & 1 deletion Tangem/Modules/Send/SendMainButtonType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ enum SendFlowActionType: Hashable {
case .withdraw: .stakeActionWithdraw
case .claimRewards: .stakeActionClaim
case .restakeRewards: .stakeActionRestake
case .unlock: .stakeActionUnlock
case .unlockLocked: .stakeActionUnlock
default: nil
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct StakingTransactionSummaryDescriptionBuilder {

extension StakingTransactionSummaryDescriptionBuilder: SendTransactionSummaryDescriptionBuilder {
func makeDescription(transactionType: SendSummaryTransactionData) -> String? {
guard case .staking(let amount, let fee, let apr) = transactionType,
guard case .staking(let amount, _, let apr) = transactionType,
let amountFiat = amount.fiat else {
return nil
}
Expand Down
Loading
Loading