Skip to content

Commit 1a3b54c

Browse files
committed
♻️ :: keyboardLayout -> keyboardMargins
1 parent 80da6d2 commit 1a3b54c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,15 +1221,15 @@ This example layout an UIImageView at the top and center it horizontally, it als
12211221

12221222

12231223
<a name="safeAreaInsets"></a>
1224-
## safeArea, keyboardLayout, readable and layout margins
1224+
## safeArea, keyboardMargins, readable and layout margins
12251225

12261226
UIKit expose 4 kind of areas/guides that can be used to layout views.
12271227
PinLayout expose them using these properties:
12281228

12291229
1. **`UIView.pin.safeArea`**: Expose UIKit `UIView.safeAreaInsets` / `UIView.safeAreaLayoutGuide`.
12301230
2. **`UIView.pin.readableMargins`**: Expose UIKit `UIView.readableContentGuide`.
12311231
3. **`UIView.pin.layoutMargins`**: Expose UIKit `UIView.layoutMargins` / `UIView.layoutMarginsGuide`.
1232-
4. **`UIView.pin.keyboardLayout`**: Expose UIKit `UIView.keyboardLayoutGuide`.
1232+
4. **`UIView.pin.keyboardMargins`**: Expose UIKit `UIView.keyboardLayoutGuide`.
12331233

12341234
The following image display the 3 areas on an iPad in landscape mode. (safeArea, readableMargins, layoutMargins)
12351235

@@ -1361,19 +1361,19 @@ PinLayout's `UIView.pin.layoutMargins` property expose directly the value of UIK
13611361

13621362
<br/>
13631363

1364-
### 4. pin.keyboardLayout:
1364+
### 4. pin.keyboardMargins:
13651365

13661366
##### Property:
1367-
* **`pin.keyboardLayout: UIEdgeInset`**
1368-
PinLayout's `UIView.pin.keyboardLayout` property expose directly the value of UIKit [`UIView.keyboardLayoutGuide`](https://developer.apple.com/documentation/uikit/keyboards_and_input/adjusting_your_layout_with_keyboard_layout_guide). This is really useful when layout adjustment due to the keyboard is required.
1367+
* **`pin.keyboardMargins: UIEdgeInset`**
1368+
PinLayout's `UIView.pin.keyboardMargins` property expose directly the value of UIKit [`UIView.keyboardLayoutGuide`](https://developer.apple.com/documentation/uikit/keyboards_and_input/adjusting_your_layout_with_keyboard_layout_guide). This is really useful when layout adjustment due to the keyboard is required.
13691369

13701370
Bottom of safe area when the keyboard undocked.
13711371

13721372
This property can be used from iOS 15 and above.
13731373

13741374
##### Usage example:
13751375
```swift
1376-
container.pin.bottom(view.pin.keyboardLayout.top)
1376+
container.pin.bottom(view.pin.keyboardMargins.top)
13771377
```
13781378

13791379

Sources/PinLayout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public class PinLayout<View: Layoutable> {
8585
}
8686

8787
#if os(iOS)
88-
public var keyboardLayout: PEdgeInsets {
88+
public var keyboardMargins: PEdgeInsets {
8989
guard #available(iOS 15.0, *) else { return .zero }
9090
guard let view = view as? UIView else { return .zero }
9191
return view.keyboardLayoutGuide

0 commit comments

Comments
 (0)