Skip to content

Commit c33d7ab

Browse files
authored
Merge pull request #229 from protosse/master
Change Objective-C API to chained call
2 parents eb3e2a3 + 8c77a73 commit c33d7ab

File tree

9 files changed

+957
-708
lines changed

9 files changed

+957
-708
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ - (void) layoutSubviews {
6767

6868
CGFloat margin = 10;
6969
UIEdgeInsets safeArea = self.pinObjc.safeArea;
70-
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];
70+
71+
logo.pinObjc.topInsets(safeArea).leftInsets(safeArea).width(100).aspectRatio().margin(margin).layout();
72+
segmented.pinObjc.rightOfAligned(logo, VerticalAlignTop).rightInsets(safeArea).marginHorizontal(margin).layout();
73+
textLabel.pinObjc.belowOfAligned(segmented, HorizontalAlignLeft).widthOf(segmented).pinEdges().marginTop(margin).sizeToFitType(FitWidth).layout();
74+
separatorView.pinObjc.belowOfViewsAligned(@[logo, textLabel], HorizontalAlignLeft).rightToEdge(segmented.edge.right).height(1).marginTop(margin).layout();
7575
}
7676

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

Sources/ObjectiveC/PinLayoutObjC.swift

+198-223
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)