Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'master' into rename_keyBoardArea
# Conflicts:
#	Sources/PinLayout.swift
  • Loading branch information
lucdion committed Feb 2, 2022
commit 0029365a241f74315acc0db7875f092fd8a9fd6f
3 changes: 1 addition & 2 deletions Example/PinLayoutSample/UI/Menu/MenuView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ extension MenuView {
// Compilation validation
#if compiler(>=5.5) // Xcode 13+
// iOS 15+
_ = tableView.pin.keyboardMargins
_ = tableView.pin.keyboardArea
#endif
}

}
2 changes: 1 addition & 1 deletion Sources/PinLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public class PinLayout<View: Layoutable> {
}
#endif

#if os(iOS)
#if os(iOS) && compiler(>=5.5) // Xcode 13+
public var keyboardArea: CGRect {
guard #available(iOS 15.0, *) else { return .zero }
guard let view = view as? UIView else { return .zero }
Expand Down
5 changes: 3 additions & 2 deletions Tests/iOS/ReadableLayoutMarginsSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,15 @@ class ReadableLayoutMargins: QuickSpec {
}

#if os(iOS) && compiler(>=5.5)
describe("Using pin.keyboardMargins") {
describe("Using pin.keyboardArea") {
it("test") {
setupWindow(with: viewController)

rootView.pin.top(0).horizontally()
rootView.pin.bottom(rootView.pin.keyboardMargins.top)
rootView.pin.bottom(rootView.pin.keyboardArea.minY)

expect(rootView.frame).to(equal(CGRect(x: 0, y: 267, width: 375, height: 400)))
expect(rootView.pin.keyboardArea).to(equal(CGRect(x: 0, y: 0, width: 0, height: 0)))
}
}
#endif
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.