@@ -83,21 +83,6 @@ public class PinLayout<View: Layoutable> {
8383 }
8484 apply ( )
8585 }
86-
87- #if os(iOS)
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-
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
10186
10287 #if os(iOS) || os(tvOS)
10388 public var safeArea : PEdgeInsets {
@@ -129,6 +114,21 @@ public class PinLayout<View: Layoutable> {
129114 return view. layoutMargins
130115 }
131116 #endif
117+
118+ #if os(iOS)
119+ public var keyboardMargins : PEdgeInsets {
120+ guard #available( iOS 15 . 0 , * ) else { return . zero }
121+ guard let view = view as? UIView else { return . zero }
122+
123+ let layoutFrame = view. keyboardLayoutGuide. layoutFrame
124+ guard !layoutFrame. isEmpty else { return . zero }
125+
126+ return UIEdgeInsets ( top: layoutFrame. origin. y,
127+ left: layoutFrame. origin. x,
128+ bottom: view. frame. height - layoutFrame. origin. y - layoutFrame. height,
129+ right: view. frame. width - layoutFrame. origin. x - layoutFrame. width)
130+ }
131+ #endif
132132
133133 //
134134 // MARK: Layout using distances from superview’s edges
0 commit comments