From 93b900191fd7f15c90412eaab45cfc4130f41da0 Mon Sep 17 00:00:00 2001 From: Alejandro Ruiz Ponce Date: Tue, 19 Nov 2024 13:27:26 +0100 Subject: [PATCH] Fix PR comments --- .../BottomSheetInteractiveDismissalTransition.swift | 2 +- .../MisticaSwiftUI/Utils/Extensions/EnvironmentValues.swift | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Mistica/Components/Sheet/View/BottomSheetPresentation/BottomSheetInteractiveDismissalTransition.swift b/Sources/Mistica/Components/Sheet/View/BottomSheetPresentation/BottomSheetInteractiveDismissalTransition.swift index 60a785024..d7527b9f0 100644 --- a/Sources/Mistica/Components/Sheet/View/BottomSheetPresentation/BottomSheetInteractiveDismissalTransition.swift +++ b/Sources/Mistica/Components/Sheet/View/BottomSheetPresentation/BottomSheetInteractiveDismissalTransition.swift @@ -11,7 +11,7 @@ import UIKit final class BottomSheetInteractiveDismissalTransition: NSObject { private enum Constants { static let maxBouncingHeight: CGFloat = 250 - static let animationDuration: CGFloat = 0.25 + @MainActor static let animationDuration: CGFloat = UIView.defaultAnimationDuration static let animationCurve: UIView.AnimationCurve = .easeOut } diff --git a/Sources/MisticaSwiftUI/Utils/Extensions/EnvironmentValues.swift b/Sources/MisticaSwiftUI/Utils/Extensions/EnvironmentValues.swift index 4f004768e..cf184d02a 100644 --- a/Sources/MisticaSwiftUI/Utils/Extensions/EnvironmentValues.swift +++ b/Sources/MisticaSwiftUI/Utils/Extensions/EnvironmentValues.swift @@ -19,9 +19,9 @@ public extension EnvironmentValues { } @available(iOSApplicationExtension, unavailable) -private struct SafeAreaInsetsKey: EnvironmentKey { - static var defaultValue: EdgeInsets { - EdgeInsets() +private struct SafeAreaInsetsKey: @preconcurrency EnvironmentKey { + @MainActor static var defaultValue: EdgeInsets { + UIApplication.shared.keyWindow?.safeAreaInsets.swiftUiInsets ?? EdgeInsets() } }