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() } }