Skip to content

Commit

Permalink
IOS-7990: Use explicit animations for content hiding because implicit…
Browse files Browse the repository at this point in the history
… ones are broken on iOS 18+

Signed-off-by: Andrey Fedorov <[email protected]>
  • Loading branch information
m3g0byt3 committed Sep 18, 2024
1 parent 402acdb commit b512c91
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
9 changes: 4 additions & 5 deletions Tangem/Modules/Markets/Common/BaseMarketsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import func SwiftUI.withAnimation

class BaseMarketsViewModel: ObservableObject {
/// For unknown reasons, the `@self` and `@identity` of our view change when push navigation is performed in other
Expand All @@ -19,10 +20,6 @@ class BaseMarketsViewModel: ObservableObject {
overlayContentProgress.interpolatedProgress(inRange: Constants.overlayContentHidingProgressInterpolationRange)
}

var overlayContentHidingAnimationDuration: TimeInterval {
Constants.overlayContentHidingAnimationDuration
}

init(
overlayContentProgressInitialValue: CGFloat
) {
Expand All @@ -32,7 +29,9 @@ class BaseMarketsViewModel: ObservableObject {
}

func onOverlayContentProgressChange(_ progress: CGFloat) {
overlayContentProgress = progress
withAnimation(.easeInOut(duration: Constants.overlayContentHidingAnimationDuration)) {
overlayContentProgress = progress
}
}
}

Expand Down
4 changes: 0 additions & 4 deletions Tangem/Modules/Markets/TokenList/MarketsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ struct MarketsView: View {
}
}
.opacity(viewModel.overlayContentHidingProgress)
.animation(
.easeInOut(duration: viewModel.overlayContentHidingAnimationDuration),
value: viewModel.overlayContentHidingProgress
)
.scrollDismissesKeyboardCompat(.immediately)
}
.alert(item: $viewModel.alert, content: { $0.alert })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ struct TokenMarketsDetailsView: View {
.background {
viewBackground
}
.animation(
.easeInOut(duration: viewModel.overlayContentHidingAnimationDuration),
value: viewModel.overlayContentHidingProgress
)
}

@ViewBuilder
Expand Down

0 comments on commit b512c91

Please sign in to comment.