Skip to content

Commit

Permalink
[iOS] Revert epoxy hosting view margin changes (#160)
Browse files Browse the repository at this point in the history
* Revert Epoxy Hosting View layout margin changes

* Update CHANGELOG.md

---------

Co-authored-by: Miguel Jimenez <miguel.jimenez@airbnb.com>
  • Loading branch information
miguel-jimenez-0529 and Miguel Jimenez authored Nov 8, 2023
1 parent 552ad8c commit 0f65f79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
approach to resolve an issue that could cause collection view cells to layout with
unexpected dimensions
- Made new layout-based SwiftUI cell rendering option the default.
- Pin `EpoxySwiftUIHostingView` content to `layoutMarginsGuide` to ensure content respects the safe area
when installed in a `TopBarContainer` or `BottomBarContainer`.

## [0.10.0](https://github.com/airbnb/epoxy-ios/compare/0.9.0...0.10.0) - 2023-06-29

Expand Down
5 changes: 2 additions & 3 deletions Sources/EpoxyCore/SwiftUI/EpoxySwiftUIHostingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public final class EpoxySwiftUIHostingView<RootView: View>: UIView, EpoxyableVie
}
})
layoutMargins = .zero
insetsLayoutMarginsFromSafeArea = false
}

@available(*, unavailable)
Expand Down Expand Up @@ -346,11 +345,11 @@ public final class EpoxySwiftUIHostingView<RootView: View>: UIView, EpoxyableVie
viewController.view.leadingAnchor.constraint(equalTo: leadingAnchor),
// Pining the hosting view controller to layoutMarginsGuide ensures the content respects the top safe area
// when installed inside a `TopBarContainer`
viewController.view.topAnchor.constraint(equalTo: layoutMarginsGuide.topAnchor),
viewController.view.topAnchor.constraint(equalTo: topAnchor),
viewController.view.trailingAnchor.constraint(equalTo: trailingAnchor),
// Pining the hosting view controller to layoutMarginsGuide ensures the content respects the bottom safe area
// when installed inside a `BottomBarContainer`
viewController.view.bottomAnchor.constraint(equalTo: layoutMarginsGuide.bottomAnchor),
viewController.view.bottomAnchor.constraint(equalTo: bottomAnchor),
])

viewController.didMove(toParent: parent)
Expand Down

0 comments on commit 0f65f79

Please sign in to comment.