Skip to content

Commit

Permalink
Use ignores instead of ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
sammygutierrez committed Jul 23, 2024
1 parent ad59297 commit ea7fc9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Sources/EpoxyCore/SwiftUI/EpoxySwiftUIHostingController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ open class EpoxySwiftUIHostingController<Content: View>: UIHostingController<Con

/// Creates a `UIHostingController` that optionally ignores the `safeAreaInsets` when laying out
/// its contained `RootView`.
public convenience init(rootView: Content, ignoreSafeArea: Bool, ignoreKeyboardAvoidance: Bool) {
public convenience init(rootView: Content, ignoresSafeArea: Bool, ignoresKeyboardAvoidance: Bool) {
self.init(rootView: rootView)

// We unfortunately need to call a private API to disable the safe area. We can also accomplish
// this by dynamically subclassing this view controller's view at runtime and overriding its
// `safeAreaInsets` property and returning `.zero`. An implementation of that logic is
// available in this file in the `2d28b3181cca50b89618b54836f7a9b6e36ea78e` commit if this API
// no longer functions in future SwiftUI versions.
_disableSafeArea = ignoreSafeArea
_disableSafeArea = ignoresSafeArea

if ignoreKeyboardAvoidance {
if ignoresKeyboardAvoidance {
disableKeyboardAvoidance()
}
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/EpoxyCore/SwiftUI/EpoxySwiftUIHostingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public final class EpoxySwiftUIHostingView<RootView: View>: UIView, EpoxyableVie
epoxyContent = EpoxyHostingContent(rootView: style.initialContent.rootView)
viewController = EpoxySwiftUIHostingController(
rootView: .init(content: epoxyContent, environment: epoxyEnvironment),
ignoreSafeArea: true,
ignoreKeyboardAvoidance: true)
ignoresSafeArea: true,
ignoresKeyboardAvoidance: true)

dataID = style.initialContent.dataID ?? DefaultDataID.noneProvided as AnyHashable
forceLayoutOnLayoutMarginsChange = style.forceLayoutOnLayoutMarginsChange
Expand Down

0 comments on commit ea7fc9a

Please sign in to comment.