Skip to content

Commit e25f291

Browse files
authored
Revert "Expose configuration to ignore EpoxySwiftUIHostingController safe area" (#165)
* Revert "Expose configuration to ignore EpoxySwiftUIHostingController safe are…" This reverts commit e46fab4. * Remove old comment
1 parent 06d9405 commit e25f291

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

Sources/EpoxyBars/BarModel/SwiftUI.View+BarModel.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,17 @@ extension View {
1111
/// - dataID: An ID that uniquely identifies this item relative to other items in the
1212
/// same collection.
1313
/// - reuseBehavior: The reuse behavior of the `EpoxySwiftUIHostingView`.
14-
/// - ignoreSafeArea: Whether or not the underlying `EpoxySwiftUIHostingController` will ignore its safe area.
15-
/// Only set this to `false` when installing this BarModel using `BarContainerInsetBehavior.barHeightContentInset` or `BarContainerInsetBehavior.none`.
1614
public func barModel(
1715
dataID: AnyHashable? = nil,
18-
reuseBehavior: SwiftUIHostingViewReuseBehavior = .reusable,
19-
ignoreSafeArea: Bool = true)
16+
reuseBehavior: SwiftUIHostingViewReuseBehavior = .reusable)
2017
-> BarModel<EpoxySwiftUIHostingView<Self>>
2118
{
2219
EpoxySwiftUIHostingView<Self>.barModel(
2320
dataID: dataID,
2421
content: .init(rootView: self, dataID: dataID),
2522
style: .init(
2623
reuseBehavior: reuseBehavior,
27-
initialContent: .init(rootView: self, dataID: dataID),
28-
ignoreSafeArea: ignoreSafeArea))
24+
initialContent: .init(rootView: self, dataID: dataID)))
2925
.linkDisplayLifecycle()
3026
}
3127
}

Sources/EpoxyCore/SwiftUI/EpoxySwiftUIHostingView.swift

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public final class EpoxySwiftUIHostingView<RootView: View>: UIView, EpoxyableVie
6767
epoxyContent = EpoxyHostingContent(rootView: style.initialContent.rootView)
6868
viewController = EpoxySwiftUIHostingController(
6969
rootView: .init(content: epoxyContent, environment: epoxyEnvironment),
70-
ignoreSafeArea: style.ignoreSafeArea)
70+
ignoreSafeArea: true)
7171

7272
dataID = style.initialContent.dataID ?? DefaultDataID.noneProvided as AnyHashable
7373

@@ -97,24 +97,13 @@ public final class EpoxySwiftUIHostingView<RootView: View>: UIView, EpoxyableVie
9797
// MARK: Public
9898

9999
public struct Style: Hashable {
100-
101-
// MARK: Lifecycle
102-
103-
public init(
104-
reuseBehavior: SwiftUIHostingViewReuseBehavior,
105-
initialContent: Content,
106-
ignoreSafeArea: Bool = true)
107-
{
100+
public init(reuseBehavior: SwiftUIHostingViewReuseBehavior, initialContent: Content) {
108101
self.reuseBehavior = reuseBehavior
109102
self.initialContent = initialContent
110-
self.ignoreSafeArea = ignoreSafeArea
111103
}
112104

113-
// MARK: Public
114-
115105
public var reuseBehavior: SwiftUIHostingViewReuseBehavior
116106
public var initialContent: Content
117-
public var ignoreSafeArea: Bool
118107

119108
public static func == (lhs: Style, rhs: Style) -> Bool {
120109
lhs.reuseBehavior == rhs.reuseBehavior
@@ -354,12 +343,8 @@ public final class EpoxySwiftUIHostingView<RootView: View>: UIView, EpoxyableVie
354343
viewController.view.translatesAutoresizingMaskIntoConstraints = false
355344
NSLayoutConstraint.activate([
356345
viewController.view.leadingAnchor.constraint(equalTo: leadingAnchor),
357-
// Pining the hosting view controller to layoutMarginsGuide ensures the content respects the top safe area
358-
// when installed inside a `TopBarContainer`
359346
viewController.view.topAnchor.constraint(equalTo: topAnchor),
360347
viewController.view.trailingAnchor.constraint(equalTo: trailingAnchor),
361-
// Pining the hosting view controller to layoutMarginsGuide ensures the content respects the bottom safe area
362-
// when installed inside a `BottomBarContainer`
363348
viewController.view.bottomAnchor.constraint(equalTo: bottomAnchor),
364349
])
365350

0 commit comments

Comments
 (0)