Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Expose configuration to ignore EpoxySwiftUIHostingController safe area" #165

Merged

Conversation

bryankeller
Copy link
Contributor

This reverts #161, which is not needed thanks to the existence of the epoxyLayoutMargins modifier.

// MARK: - View

extension View {
  /// Applies the layout margins from the parent `EpoxySwiftUIHostingView` to this `View`, if there
  /// are any.
  ///
  /// Can be used to have a background in SwiftUI underlap the safe area within a bar installer, for
  /// example.
  ///
  /// These margins are propagated via the `EnvironmentValues.epoxyLayoutMargins`.
  public func epoxyLayoutMargins() -> some View {
    modifier(EpoxyLayoutMarginsPadding())
  }
}

We can go back to always forcing EpoxySwiftUIHostingView to ignore safe area insets. Anyone who wants a bar to go into the safe area region can do so using epoxyLayoutMargins.

Note: We can't apply epoxyLayoutMargins automatically for bars because the exact position that the padding is inserted is view-specific. For example, people probably want to use the epoxyLayoutMargins modifier before a background modifier.

@bryankeller bryankeller added the EpoxyBars any issues related to EpoxyBars label Mar 15, 2024
Copy link
Contributor

@brynbodayle brynbodayle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryankeller bryankeller merged commit e25f291 into master Mar 15, 2024
9 checks passed
@bryankeller bryankeller deleted the revert-161-mj-expose-safe-area-configuration-in-style branch March 15, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EpoxyBars any issues related to EpoxyBars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants