Skip to content

Commit 1f06fe3

Browse files
committed
update PinLayoutObjC
1 parent 1b566b7 commit 1f06fe3

File tree

3 files changed

+970
-653
lines changed

3 files changed

+970
-653
lines changed

Example/PinLayoutSample/UI/Examples/IntroObjectiveC/IntroObjectiveCView.m

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,30 @@ - (void) layoutSubviews {
6868
CGFloat margin = 10;
6969
UIEdgeInsets safeArea = self.pinObjc.safeArea;
7070

71-
[[[[[[logo.pinObjc topWithInsets:safeArea] leftWithInsets:safeArea] width:100] aspectRatio] margin:margin] layout];
72-
[[[[segmented.pinObjc rightOf:logo aligned:VerticalAlignTop] rightWithInsets:safeArea] marginHorizontal:margin] layout];
73-
[[[[[[textLabel.pinObjc belowOf:segmented aligned:HorizontalAlignLeft] widthOf:segmented] pinEdges] marginTop:margin] sizeToFit:FitWidth] layout];
74-
[[[[[separatorView.pinObjc belowOfViews:@[logo, textLabel] aligned:HorizontalAlignLeft] rightTo:segmented.edge.right] height:1] marginTop:margin] layout];
71+
// [[[[[[logo.pinObjc topWithInsets:safeArea] leftWithInsets:safeArea] width:100] aspectRatio] margin:margin] layout];
72+
// [[[[segmented.pinObjc rightOf:logo aligned:VerticalAlignTop] rightWithInsets:safeArea] marginHorizontal:margin] layout];
73+
// [[[[[[textLabel.pinObjc belowOf:segmented aligned:HorizontalAlignLeft] widthOf:segmented] pinEdges] marginTop:margin] sizeToFit:FitWidth] layout];
74+
// [[[[[separatorView.pinObjc belowOfViews:@[logo, textLabel] aligned:HorizontalAlignLeft] rightTo:segmented.edge.right] height:1] marginTop:margin] layout];
75+
[logo.pinObjc
76+
.topInsets(safeArea)
77+
.leftInsets(safeArea)
78+
.width(100).aspectRatio()
79+
.margin(margin) layout];
80+
[segmented.pinObjc
81+
.rightOfAligned(logo, VerticalAlignTop)
82+
.rightInsets(safeArea)
83+
.marginHorizontal(margin) layout];
84+
[textLabel.pinObjc
85+
.belowOfAligned(segmented, HorizontalAlignLeft)
86+
.widthOf(segmented)
87+
.pinEdges()
88+
.marginTop(margin)
89+
.sizeToFitType(FitWidth) layout];
90+
[separatorView.pinObjc
91+
.belowOfViewsAligned(@[logo, textLabel], HorizontalAlignLeft)
92+
.rightToEdge(segmented.edge.right)
93+
.height(1)
94+
.marginTop(margin) layout];
7595
}
7696

7797
- (void) setLayoutGuidesTop:(CGFloat)top {

0 commit comments

Comments
 (0)