You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* `all()`: Pin all edges on its superview's corresponding edges (top, bottom, left, right). Similar to calling `view.top().bottom().left().right()`
* `horizontally()`: Pin the left and right edges on its superview's corresponding edges. Similar to calling `view.left().right()`.
* `vertically()`: Pin the **top and bottom edges** on its superview's corresponding edges. Similar to calling `view.top().bottom()`.
@@ -252,7 +252,7 @@ In LTR direction the value specifies the right edge distance from the superview'
252
252
In RTL direction the value specifies the left edge distance from the superview's left edge in pixels.
253
253
***`end(_ percent: Percent)`**:left_right_arrow:
254
254
In LTR direction the value specifies the right edge distance from the superview's right edge in percentage of its superview's width.
255
-
In RTL direction the value specifies the left edge distance from the superview's left edge in percentage of its superview's width.
255
+
In RTL direction the value specifies the left edge distance from the superview's left edge in percentage of its superview's width.
256
256
257
257
###### Usage Examples:
258
258
@@ -273,7 +273,7 @@ This example layout the view A to fit its superview frame with a margin of 10 pi
273
273
Another possible solution using other PinLayout's methods (more details later):
274
274
275
275
```swift
276
-
view.pin.top().bottom().left().right().margin(10)
276
+
view.pin.all().margin(10)
277
277
```
278
278
279
279
<br/>
@@ -301,21 +301,36 @@ Position the view left edge directly on its superview left edge in LTR direction
301
301
***`end()`**:left_right_arrow:
302
302
Position the view right edge directly on its superview right edge in LTR direction or left edge directly on its superview left edge in RTL direction. Similar to calling `end(0)`.
303
303
304
+
**Methods pinning multiple edges**:
305
+
306
+
***`all()`**
307
+
Pin **all edges** on its superview's corresponding edges (top, bottom, left, right).
308
+
Similar to calling `view.top().bottom().left().right()`.
309
+
***`horizontally()`**
310
+
Pin the **left and right edges** on its superview's corresponding edges.
311
+
Similar to calling `view.left().right()`.
312
+
***`vertically()`**
313
+
Pin the **top and bottom edges** on its superview's corresponding edges.
314
+
Similar to calling `view.top().bottom()`.
315
+
316
+
304
317
###### Usage examples:
305
318
```swift
306
319
view.pin.top().left()
307
320
view.pin.bottom().right()
308
321
view.pin.hCenter().vCenter()
309
322
view.pin.start().end()
323
+
view.pin.all()
324
+
view.pin.top().horizontally()
310
325
```
311
326
312
327
###### Example:
313
-
This example is similar to the previous example, but pins edges directly on superview’s edges. It will layout the view A to fit its superview frame with a margin of 10 pixels.
328
+
This example is similar to the previous example, but pins edges directly on superview’s edges. It will layout the view A to fit its superview frame with a margin of 10 pixels all around.
@@ -537,14 +552,6 @@ Position the view above the specified view(s). One or many relative views can be
537
552
**`below(of: [UIView])`**
538
553
Position the view below the specified view(s). One or many relative views can be specified. This method is similar to pinning the view’s top edge.
539
554
540
-
***`left(of: UIView)`**
541
-
**`left(of: [UIView])`**
542
-
Position the view left of the specified view(s). One or many relative views can be specified. This method is similar to pinning the view’s right edge.
543
-
544
-
***`right(of: UIView)`**
545
-
**`right(of: [UIView])`**
546
-
Position the view right of the specified view(s). One or many relative views can be specified. This method is similar to pinning the view’s left edge.
547
-
548
555
***`before(of: UIView)`**:left_right_arrow:
549
556
**`before(of: [UIView])`**:left_right_arrow:
550
557
In LTR direction the view is positionned at the left of the specified view(s). In RTL direction the view is positionned at the right. One or many relative views can be specified.
@@ -553,6 +560,14 @@ In LTR direction the view is positionned at the left of the specified view(s). I
553
560
**`after(of: [UIView])`**:left_right_arrow:
554
561
In LTR direction the view is positionned at the right of the specified view(s). In RTL direction the view is positionned at the left. One or many relative views can be specified.
555
562
563
+
***`left(of: UIView)`**
564
+
**`left(of: [UIView])`**
565
+
Position the view left of the specified view(s). Similar to `before(of:)`. One or many relative views can be specified. This method is similar to pinning the view’s right edge.
566
+
567
+
***`right(of: UIView)`**
568
+
**`right(of: [UIView])`**
569
+
Position the view right of the specified view(s). Similar to `after(of:)`. One or many relative views can be specified. This method is similar to pinning the view’s left edge.
570
+
556
571
:pushpin:**Multiple relative views**: If for example a call to `below(of: [...]) specify multiple relative views, the view will be layouted below *ALL* these views.
557
572
558
573
:pushpin: These methods **set the position of a view's edge**: top, left, bottom or right. For example `below(of ...)` set the view's top edge, `right(of ...) set the view's left edge, ...
@@ -561,10 +576,10 @@ In LTR direction the view is positionned at the right of the specified view(s).
Position the view below the specified view(s) and aligned it using the specified HorizontalAlignment. One or many relative views can be specified. This method is similar to pinning one view’s anchor: topLeft, topCenter or topRight.
Position the view left of the specified view(s) and aligned it using the specified VerticalAlignment. One or many relative views can be specified. This method is similar to pinning one view’s anchor: topRight, centerRight or bottomRight.
Position the view right of the specified view(s) and aligned it using the specified VerticalAlignment. One or many relative views can be specified. This method is similar to pinning one view’s anchor: topLeft, centerLeft or bottomLeft.
In LTR direction the view is positionned at the left of the specified view(s). In RTL direction the view is positionned at the right. One or many relative views can be specified.
@@ -621,6 +628,14 @@ In LTR direction the view is positionned at the left of the specified view(s). I
In LTR direction the view is positionned at the right of the specified view(s). In RTL direction the view is positionned at the left. One or many relative views can be specified.
Position the view left of the specified view(s) and aligned it using the specified VerticalAlignment. Similar to `before(of:)`. One or many relative views can be specified. This method is similar to pinning one view’s anchor: topRight, centerRight or bottomRight.
Position the view right of the specified view(s) and aligned it using the specified VerticalAlignment. Similar to `after(of:)`. One or many relative views can be specified. This method is similar to pinning one view’s anchor: topLeft, centerLeft or bottomLeft.
638
+
624
639
625
640
**How alignment is applied:**
626
641
@@ -648,7 +663,7 @@ In RTL direction the view's left edge will be aligned to the right most relative
0 commit comments