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 6 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
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 @@ -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 @@ -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
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
2 changes: 0 additions & 2 deletions Tangem/Modules/ExpressApprove/ExpressApproveViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ private extension ExpressApproveViewModel {
viewModel.subheader = Localization.givePermissionSwapSubtitle(provider.name, currencySymbol)
}
}

let currencySymbol = expressInteractor.getSender().tokenItem.currencySymbol
}

func sendApproveTransaction() {
Expand Down
2 changes: 1 addition & 1 deletion Tangem/Modules/LegacySend/LegacySendViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ class LegacySendViewModel: ObservableObject {
])

let fullErrorDescription: String
if let blockchainSdkError = error as? BlockchainSdkError {
if let blockchainSdkError = error.error as? BlockchainSdkError {
fullErrorDescription = blockchainSdkError.errorDescriptionWithCode
} else {
fullErrorDescription = error.localizedDescription
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 @@ -115,13 +115,6 @@ extension MarketsTokenDetailsInsightsView {
}

#Preview {
let records: [MarketsTokenDetailsInsightsView.RecordInfo] = [
.init(type: .buyers, recordData: "+44"),
.init(type: .buyPressure, recordData: "-$400"),
.init(type: .holdersChange, recordData: "+100"),
.init(type: .liquidity, recordData: "+445,9K"),
]

return MarketsTokenDetailsInsightsView(
viewModel: .init(
insights: .init(dto: MarketsDTO.Coins.Insights(
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/StakingModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private extension StakingModel {
}

func mapToSendFee(transaction: LoadingValue<StakingTransactionInfo>?) -> SendFee {
var value = transaction?.mapValue { tx in
let value = transaction?.mapValue { tx in
Fee(.init(with: feeTokenItem.blockchain, type: feeTokenItem.amountType, value: tx.fee))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// WelcomeOnboardingPushNotificationsView.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 @@ -2,7 +2,7 @@
// PushNotificationsAvailabilityProvider.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 @@
// PushNotificationsPermissionManagerStub.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
2 changes: 1 addition & 1 deletion Tangem/RootViewControllerFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RootViewControllerFactory.swift
// Tangem
//
// Created by m3g0byt3 on 12.07.2024.
// Created by Andrey Fedorov on 12.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 @@
// OnboardingFeatureDescriptionView.swift
// Tangem
//
// Created by m3g0byt3 on 30.06.2024.
// Created by Andrey Fedorov on 30.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 @@
// OverlayContentContainer+Environment.swift
// Tangem
//
// Created by m3g0byt3 on 12.07.2024.
// Created by Andrey Fedorov on 12.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 @@
// OverlayContentContainer.swift
// Tangem
//
// Created by m3g0byt3 on 12.07.2024.
// Created by Andrey Fedorov on 12.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 @@
// OverlayContentContainerViewControllerAdapter.swift
// Tangem
//
// Created by m3g0byt3 on 12.07.2024.
// Created by Andrey Fedorov on 12.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 @@
// OverlayContentContainerViewModifier.swift
// Tangem
//
// Created by m3g0byt3 on 12.07.2024.
// Created by Andrey Fedorov on 12.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 @@
// OverlayContentStateController.swift
// Tangem
//
// Created by m3g0byt3 on 16.07.2024.
// Created by Andrey Fedorov on 16.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 @@
// OverlayContentStateObserver.swift
// Tangem
//
// Created by m3g0byt3 on 16.07.2024.
// Created by Andrey Fedorov on 16.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 @@
// OverlayContentStateObserverViewModifier.swift
// Tangem
//
// Created by m3g0byt3 on 16.07.2024.
// Created by Andrey Fedorov on 16.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 @@
// OverlayContentContainerViewController.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 @@
// ScrollViewContentOffsetLocker.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
Loading