diff --git a/Sources/FluentUI_iOS/Components/Notification/MSFNotification.swift b/Sources/FluentUI_iOS/Components/Notification/MSFNotification.swift index 784214b8b..8cf5a40d2 100644 --- a/Sources/FluentUI_iOS/Components/Notification/MSFNotification.swift +++ b/Sources/FluentUI_iOS/Components/Notification/MSFNotification.swift @@ -25,7 +25,7 @@ import UIKit self.isFlexibleWidthToast = isFlexibleWidthToast && style.isToast notification = FluentNotification(style: style, shouldSelfPresent: false) - super.init(AnyView(notification)) + super.init(AnyView(notification), safeAreaRegions: []) let defaultDismissAction = { [weak self] in guard let strongSelf = self else { return diff --git a/Sources/FluentUI_iOS/Core/ControlHostingView.swift b/Sources/FluentUI_iOS/Core/ControlHostingView.swift index 13e7ee6af..22e93c1df 100644 --- a/Sources/FluentUI_iOS/Core/ControlHostingView.swift +++ b/Sources/FluentUI_iOS/Core/ControlHostingView.swift @@ -35,9 +35,16 @@ open class ControlHostingView: UIView { /// the control view in an `AnyView.` /// /// - Parameter controlView: An `AnyView`-wrapped component to host. - public init(_ controlView: AnyView) { + /// - Parameter safeAreaRegions: Passthrough to the respective property on UIHostingController. + /// Indicates which safe area regions the underlying hosting controller should add to its view. + public init(_ controlView: AnyView, safeAreaRegions: SafeAreaRegions = .all) { hostingController = FluentThemedHostingController.init(rootView: controlView) hostingController.sizingOptions = [.intrinsicContentSize] + + if #available(iOS 16.4, *) { + hostingController.safeAreaRegions = safeAreaRegions + } + super.init(frame: .zero) self.configureHostedView()