We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a3b54c commit bb575b0Copy full SHA for bb575b0
Example/.DS_Store
0 Bytes
Sources/PinLayout.swift
@@ -88,7 +88,14 @@ public class PinLayout<View: Layoutable> {
88
public var keyboardMargins: PEdgeInsets {
89
guard #available(iOS 15.0, *) else { return .zero }
90
guard let view = view as? UIView else { return .zero }
91
- return view.keyboardLayoutGuide
+
92
+ let layoutFrame = view.keyboardLayoutGuide.layoutFrame
93
+ guard !layoutFrame.isEmpty else { return .zero }
94
95
+ return UIEdgeInsets(top: layoutFrame.origin.y,
96
+ left: layoutFrame.origin.x,
97
+ bottom: view.frame.height - layoutFrame.origin.y - layoutFrame.height,
98
+ right: view.frame.width - layoutFrame.origin.x - layoutFrame.width)
99
}
100
#endif
101
0 commit comments