Skip to content

Commit 36543cf

Browse files
authored
Merge pull request #175 from layoutBox/update_samples_between
Update documentation and update sample's app source code
2 parents 710630b + 92725f7 commit 36543cf

File tree

24 files changed

+250
-140
lines changed

24 files changed

+250
-140
lines changed

Example/PinLayoutSample.xcodeproj/project.pbxproj

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
2439CC351E665BF6003326FB /* MenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2439CC331E665BF6003326FB /* MenuView.swift */; };
1515
2439CC361E665BF6003326FB /* MenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2439CC341E665BF6003326FB /* MenuViewController.swift */; };
1616
2439CC4B1E665C6B003326FB /* BasicView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2439CC381E665C6B003326FB /* BasicView.swift */; };
17-
2439CC521E665C6B003326FB /* MultiRelativeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2439CC3F1E665C6B003326FB /* MultiRelativeView.swift */; };
18-
2439CC531E665C6B003326FB /* MultiRelativeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2439CC401E665C6B003326FB /* MultiRelativeViewController.swift */; };
17+
2439CC521E665C6B003326FB /* BetweenView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2439CC3F1E665C6B003326FB /* BetweenView.swift */; };
18+
2439CC531E665C6B003326FB /* BetweenViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2439CC401E665C6B003326FB /* BetweenViewController.swift */; };
1919
2439CC541E665C6B003326FB /* RelativeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2439CC411E665C6B003326FB /* RelativeView.swift */; };
2020
2439CC551E665C6B003326FB /* RelativeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2439CC421E665C6B003326FB /* RelativeViewController.swift */; };
2121
247157941F87BD680003424F /* UIEdgeInsets+PinLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 247157931F87BD680003424F /* UIEdgeInsets+PinLayout.swift */; };
@@ -147,8 +147,8 @@
147147
2439CC331E665BF6003326FB /* MenuView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuView.swift; sourceTree = "<group>"; };
148148
2439CC341E665BF6003326FB /* MenuViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuViewController.swift; sourceTree = "<group>"; };
149149
2439CC381E665C6B003326FB /* BasicView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BasicView.swift; sourceTree = "<group>"; };
150-
2439CC3F1E665C6B003326FB /* MultiRelativeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MultiRelativeView.swift; sourceTree = "<group>"; };
151-
2439CC401E665C6B003326FB /* MultiRelativeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MultiRelativeViewController.swift; sourceTree = "<group>"; };
150+
2439CC3F1E665C6B003326FB /* BetweenView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BetweenView.swift; sourceTree = "<group>"; };
151+
2439CC401E665C6B003326FB /* BetweenViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BetweenViewController.swift; sourceTree = "<group>"; };
152152
2439CC411E665C6B003326FB /* RelativeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RelativeView.swift; sourceTree = "<group>"; };
153153
2439CC421E665C6B003326FB /* RelativeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RelativeViewController.swift; sourceTree = "<group>"; };
154154
246812FC1F8D013500462E53 /* NotificationCenter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NotificationCenter.framework; path = System/Library/Frameworks/NotificationCenter.framework; sourceTree = SDKROOT; };
@@ -262,15 +262,15 @@
262262
children = (
263263
24F75B581EE5642C008DB567 /* Intro */,
264264
24CB99991F290591004EA7FB /* AdjustToContainer */,
265-
DF66F9D61E8493D400ADB8D5 /* AutoAdjustingSize */,
266265
24A9C1EF1EF0542500F2CF64 /* TableViewExample */,
267266
24F2460C1FA8D4D100B6332E /* CollectionViewExample */,
268-
DF4C1A9F205AEDFC00DED50B /* SafeArea */,
269-
DFEAF71520C840F300E33147 /* WrapContent */,
270267
DF3908912118FFF20049FD56 /* Animations */,
268+
DF66F9D61E8493D400ADB8D5 /* AutoAdjustingSize */,
269+
DF4C1A9F205AEDFC00DED50B /* SafeArea */,
271270
2439CC631E66606D003326FB /* RelativeView */,
272-
2439CC5F1E665F66003326FB /* MultiRelativeView */,
271+
2439CC5F1E665F66003326FB /* BetweenView */,
273272
2497CFEA1EF40B8100DFD13B /* Form */,
273+
DFEAF71520C840F300E33147 /* WrapContent */,
274274
DFD31B9D212EE4D600566CA4 /* TableViewReadableContent */,
275275
24D18D181F3DECD6008129EF /* IntroRTL */,
276276
2416376F1F8E4BC200EE703A /* IntroObjectiveC */,
@@ -293,13 +293,13 @@
293293
path = Common;
294294
sourceTree = "<group>";
295295
};
296-
2439CC5F1E665F66003326FB /* MultiRelativeView */ = {
296+
2439CC5F1E665F66003326FB /* BetweenView */ = {
297297
isa = PBXGroup;
298298
children = (
299-
2439CC3F1E665C6B003326FB /* MultiRelativeView.swift */,
300-
2439CC401E665C6B003326FB /* MultiRelativeViewController.swift */,
299+
2439CC3F1E665C6B003326FB /* BetweenView.swift */,
300+
2439CC401E665C6B003326FB /* BetweenViewController.swift */,
301301
);
302-
path = MultiRelativeView;
302+
path = BetweenView;
303303
sourceTree = "<group>";
304304
};
305305
2439CC631E66606D003326FB /* RelativeView */ = {
@@ -729,14 +729,14 @@
729729
24CB99981F290540004EA7FB /* MethodGroupHeader.swift in Sources */,
730730
2439CC361E665BF6003326FB /* MenuViewController.swift in Sources */,
731731
24F246111FA8D4D100B6332E /* CollectionViewExampleViewController.swift in Sources */,
732-
2439CC531E665C6B003326FB /* MultiRelativeViewController.swift in Sources */,
732+
2439CC531E665C6B003326FB /* BetweenViewController.swift in Sources */,
733733
DF4C1AA4205AEDFC00DED50B /* SafeAreaView.swift in Sources */,
734734
241637771F8E4F9100EE703A /* IntroObjectiveCView.m in Sources */,
735735
24CB99A01F290664004EA7FB /* ChoiceSelectorView.swift in Sources */,
736736
249326891EEEEE3D00BCB814 /* Stylesheet.swift in Sources */,
737737
DFD31BA0212EE4F200566CA4 /* TableViewReadableContentView.swift in Sources */,
738738
DF39089A211900480049FD56 /* AnimationsViewController.swift in Sources */,
739-
2439CC521E665C6B003326FB /* MultiRelativeView.swift in Sources */,
739+
2439CC521E665C6B003326FB /* BetweenView.swift in Sources */,
740740
24F246101FA8D4D100B6332E /* CollectionViewExampleView.swift in Sources */,
741741
24A9C1F21EF0542F00F2CF64 /* TableViewExampleView.swift in Sources */,
742742
24CB999D1F29059B004EA7FB /* AdjustToContainerViewController.swift in Sources */,

Example/PinLayoutSample/UI/Examples/Animations/AnimationsView.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,10 @@ class AnimationsView: UIView {
107107
case .imageLeft:
108108
houseImageView.pin.below(of: segmented).left(margin).marginTop(margin).size(140)
109109
titleLabel.pin.after(of: houseImageView, aligned: .top).marginLeft(margin).sizeToFit()
110-
descriptionLabel.pin.below(of: titleLabel, aligned: .left).right(margin)
111-
.marginTop(margin).sizeToFit(.width)
110+
descriptionLabel.pin.below(of: titleLabel, aligned: .left).right(margin).marginTop(margin).sizeToFit(.width)
112111

113112
case .imageRight:
114-
houseImageView.pin.below(of: segmented).right(margin).size(140).marginTop(margin)
113+
houseImageView.pin.below(of: segmented).right(margin).marginTop(margin).size(140)
115114
titleLabel.pin.below(of: segmented, aligned: .left).margin(margin).sizeToFit()
116115
descriptionLabel.pin.below(of: titleLabel, aligned: .left).before(of: houseImageView).marginTop(margin).marginRight(margin).sizeToFit(.width)
117116

Example/PinLayoutSample/UI/Examples/AutoAdjustingSize/AutoAdjustingSizeView.swift

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ class AutoAdjustingSizeView: UIView {
2424

2525
private let contentScrollView = UIScrollView()
2626

27-
var row1 = BasicView(text: "", color: .lightGray)
27+
var row1Container = BasicView(text: "", color: .lightGray)
2828
var row1Item1 = BasicView(text: "50px", color: .gray)
2929
var row1Item2 = BasicView(text: "Remaining space", color: .pinLayoutColor)
3030

31-
var row2 = BasicView(text: "", color: .lightGray)
31+
var row2Container = BasicView(text: "", color: .lightGray)
3232
var row2Item1 = BasicView(text: "150px", color: .gray)
3333
var row2Item2 = BasicView(text: "Remaining space", color: .pinLayoutColor)
3434

35-
var row3 = BasicView(text: "", color: .lightGray)
35+
var row3Container = BasicView(text: "", color: .lightGray)
3636
var row3Item1 = BasicView(text: "50px", color: .gray)
3737
var row3Item2 = BasicView(text: "Remaining space", color: .pinLayoutColor)
3838
var row3Item3 = BasicView(text: "Remaining space", color: .pinLayoutColor)
3939

40-
var row4 = BasicView(text: "", color: .lightGray)
40+
var row4Container = BasicView(text: "", color: .lightGray)
4141
var row4Item1 = BasicView(text: "25%", color: .pinLayoutColor)
4242
var row4Item2 = BasicView(text: "50%", color: .gray)
4343
var row4Item3 = BasicView(text: "25%", color: .pinLayoutColor)
@@ -49,23 +49,23 @@ class AutoAdjustingSizeView: UIView {
4949
contentScrollView.backgroundColor = .white
5050
addSubview(contentScrollView)
5151

52-
contentScrollView.addSubview(row1)
53-
row1.addSubview(row1Item1)
54-
row1.addSubview(row1Item2)
52+
contentScrollView.addSubview(row1Container)
53+
row1Container.addSubview(row1Item1)
54+
row1Container.addSubview(row1Item2)
5555

56-
contentScrollView.addSubview(row2)
57-
row2.addSubview(row2Item1)
58-
row2.addSubview(row2Item2)
56+
contentScrollView.addSubview(row2Container)
57+
row2Container.addSubview(row2Item1)
58+
row2Container.addSubview(row2Item2)
5959

60-
contentScrollView.addSubview(row3)
61-
row3.addSubview(row3Item1)
62-
row3.addSubview(row3Item2)
63-
row3.addSubview(row3Item3)
60+
contentScrollView.addSubview(row3Container)
61+
row3Container.addSubview(row3Item1)
62+
row3Container.addSubview(row3Item2)
63+
row3Container.addSubview(row3Item3)
6464

65-
contentScrollView.addSubview(row4)
66-
row4.addSubview(row4Item1)
67-
row4.addSubview(row4Item2)
68-
row4.addSubview(row4Item3)
65+
contentScrollView.addSubview(row4Container)
66+
row4Container.addSubview(row4Item1)
67+
row4Container.addSubview(row4Item2)
68+
row4Container.addSubview(row4Item3)
6969
}
7070

7171
required init?(coder aDecoder: NSCoder) {
@@ -77,24 +77,24 @@ class AutoAdjustingSizeView: UIView {
7777

7878
contentScrollView.pin.all()
7979

80-
row1.pin.top().horizontally(pin.safeArea).height(40)
80+
row1Container.pin.top().horizontally(pin.safeArea).height(40)
8181
row1Item1.pin.vertically().left().width(50).margin(2)
82-
row1Item2.pin.right(of: row1Item1, aligned: .top).bottomRight().margin(0, 2, 2, 2)
82+
row1Item2.pin.after(of: row1Item1, aligned: .top).bottomRight().margin(0, 2, 2, 2)
8383

84-
row2.pin.below(of: row1, aligned: .left).size(of: row1).marginTop(10)
84+
row2Container.pin.below(of: row1Container, aligned: .left).size(of: row1Container).marginTop(10)
8585
row2Item1.pin.vertically().right().width(150).margin(2)
86-
row2Item2.pin.left(of: row2Item1, aligned: .top).left().bottom().margin(0, 2, 2, 2)
86+
row2Item2.pin.before(of: row2Item1, aligned: .top).left().bottom().margin(0, 2, 2, 2)
8787

88-
row3.pin.below(of: row2, aligned: .left).size(of: row1).marginTop(10)
89-
row3Item1.pin.topCenter().bottom().width(50).margin(2)
90-
row3Item2.pin.left(of: row3Item1, aligned: .top).left().bottom().margin(0, 2, 2, 2)
91-
row3Item3.pin.right(of: row3Item1, aligned: .top).right().bottom().margin(0, 2, 2, 2)
88+
row3Container.pin.below(of: row2Container, aligned: .left).size(of: row1Container).marginTop(10)
89+
row3Item1.pin.vertically().hCenter().width(50).margin(2)
90+
row3Item2.pin.before(of: row3Item1, aligned: .top).left().bottom().margin(0, 2, 2, 2)
91+
row3Item3.pin.after(of: row3Item1, aligned: .top).right().bottom().margin(0, 2, 2, 2)
9292

93-
row4.pin.below(of: row3, aligned: .left).size(of: row1).marginTop(10)
94-
row4Item1.pin.top().left().width(25%).bottom().margin(2)
95-
row4Item2.pin.right(of: row4Item1, aligned: .top).width(50%).bottom().margin(0, 2, 2, 2)
96-
row4Item3.pin.right(of: row4Item2, aligned: .top).right().bottom().margin(0, 2, 2, 2)
93+
row4Container.pin.below(of: row3Container, aligned: .left).size(of: row1Container).marginTop(10)
94+
row4Item1.pin.vertically().left().width(25%).margin(2)
95+
row4Item2.pin.after(of: row4Item1, aligned: .top).width(50%).bottom().margin(0, 2, 2, 2)
96+
row4Item3.pin.after(of: row4Item2, aligned: .top).right().bottom().margin(0, 2, 2, 2)
9797

98-
contentScrollView.contentSize = CGSize(width: contentScrollView.frame.width, height: row4.frame.maxY)
98+
contentScrollView.contentSize = CGSize(width: contentScrollView.frame.width, height: row4Container.frame.maxY)
9999
}
100100
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
import UIKit
2121
import PinLayout
2222

23-
class MultiRelativeView: UIView {
23+
class BetweenView: UIView {
2424
private let view1 = BasicView(text: "Relative view 1 (width: 20%, height: 50%)", color: .lightGray)
2525
private let view2 = BasicView(text: "Relative view 2 (width: 20%, height: 50%)", color: .lightGray)
26-
private let view = BasicView(text: "View layouted using two relative views: \n - right(of: view1, aligned: .top)\n - left(of: view2, aligned: .bottom)",
26+
private let view = BasicView(text: "View layouted using method horizontallyBetween: \n - horizontallyBetween(view1, and: view2, aligned: .top)",
2727
color: .pinLayoutColor)
2828

2929
init() {
@@ -45,6 +45,6 @@ class MultiRelativeView: UIView {
4545
view1.pin.top(pin.safeArea).left(pin.safeArea).width(20%).height(50%)
4646
view2.pin.top(pin.safeArea).right(pin.safeArea).width(20%).height(50%)
4747

48-
view.pin.after(of: view1, aligned: .top).before(of: view2, aligned: .bottom).marginHorizontal(10)
48+
view.pin.horizontallyBetween(view1, and: view2, aligned: .top).height(of: view1).marginHorizontal(10)
4949
}
5050
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
import UIKit
2121

22-
class MultiRelativeViewController: UIViewController {
23-
private var mainView: MultiRelativeView {
24-
return self.view as! MultiRelativeView
22+
class BetweenViewController: UIViewController {
23+
private var mainView: BetweenView {
24+
return self.view as! BetweenView
2525
}
2626

2727
init(pageType: PageType) {
@@ -35,6 +35,6 @@ class MultiRelativeViewController: UIViewController {
3535
}
3636

3737
override func loadView() {
38-
view = MultiRelativeView()
38+
view = BetweenView()
3939
}
4040
}

Example/PinLayoutSample/UI/Examples/CollectionViewExample/HouseCell.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class HouseCell: UICollectionViewCell {
2626
private let priceLabel = UILabel()
2727
private let distanceLabel = UILabel()
2828

29-
private let padding: CGFloat = 8
29+
private let margin: CGFloat = 8
3030

3131
override init(frame: CGRect) {
3232
super.init(frame: frame)
@@ -79,15 +79,15 @@ class HouseCell: UICollectionViewCell {
7979
}
8080

8181
private func layout() {
82-
headerView.pin.top().horizontally(pin.safeArea).height(100)
83-
nameLabel.pin.top().horizontally().margin(padding).sizeToFit(.width)
82+
headerView.pin.top().horizontally(pin.safeArea).height(40)
83+
nameLabel.pin.vCenter().horizontally(margin).sizeToFit(.width)
8484

85-
mainImage.pin.below(of: nameLabel).horizontally(pin.safeArea).height(300).marginTop(padding)
85+
mainImage.pin.below(of: headerView).horizontally(pin.safeArea).height(300)
8686

8787
footerView.pin.below(of: mainImage).horizontally(pin.safeArea)
88-
priceLabel.pin.top().horizontally().margin(6, padding).sizeToFit(.width)
89-
distanceLabel.pin.top().after(of: priceLabel).right().margin(6, padding).sizeToFit(.width)
90-
footerView.pin.height(max(priceLabel.frame.maxY, distanceLabel.frame.maxY) + 6)
88+
priceLabel.pin.top().horizontally().margin(margin).sizeToFit(.widthFlexible)
89+
distanceLabel.pin.top().after(of: priceLabel).right().margin(margin).sizeToFit(.width)
90+
footerView.pin.wrapContent(.vertically, padding: margin)
9191

9292
contentView.pin.height(footerView.frame.maxY)
9393
}

Example/PinLayoutSample/UI/Examples/Form/FormView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,20 @@ class FormView: BaseFormView {
7878
let margin: CGFloat = 12
7979

8080
// Layout the formContainerView using the view's safeArea.
81-
formContainerView.pin.top().hCenter().width(100%).maxWidth(400).pinEdges().margin(margin, margin, margin)
81+
formContainerView.pin.top().hCenter().width(100%).maxWidth(400).pinEdges().margin(margin)
8282

83-
formTitleLabel.pin.topCenter().margin(margin)
83+
formTitleLabel.pin.topCenter(margin)
8484

8585
nameField.pin.below(of: formTitleLabel).horizontally().height(40).margin(margin)
8686

87-
ageSwitch.pin.below(of: nameField).horizontally().height(40).margin(margin)
87+
ageSwitch.pin.below(of: nameField, aligned: .left).marginTop(margin).sizeToFit()
8888
ageField.pin.below(of: ageSwitch).horizontally().height(40).margin(margin)
8989

9090
// Layout the Address UITextField below the last visible view, either ageSwitch or ageField.
9191
addressField.pin.below(of: visible([ageSwitch, ageField])).horizontally().height(40).margin(margin)
9292

9393
// Adjust the form container bottom to contains all its childrens
94-
formContainerView.pin.height(addressField.frame.maxY + margin)
94+
formContainerView.pin.wrapContent(.vertically, padding: margin)
9595

9696
// Adjust UIScrollView contentSize
9797
formScrollView.contentSize = formContainerView.frame.size

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,14 @@ - (void)dealloc {
6464

6565
- (void) layoutSubviews {
6666
[super layoutSubviews];
67+
68+
CGFloat margin = 10;
69+
UIEdgeInsets safeArea = self.pinObjc.safeArea;
6770

68-
[[[[[[logo.pinObjc top] left] width:100] aspectRatio] marginWithTop:topLayoutGuide + 10 horizontal:10 bottom:10] layout];
69-
[[[[segmented.pinObjc rightOf:logo aligned:VerticalAlignTop] right] marginHorizontal:10] layout];
70-
[[[[[[textLabel.pinObjc belowOf:segmented aligned:HorizontalAlignLeft] widthOf:segmented] pinEdges] marginTop:10] sizeToFit:FitWidth] layout];
71-
[[[[[separatorView.pinObjc belowOfViews:@[logo, textLabel] aligned:HorizontalAlignLeft] rightTo:segmented.edge.right] height:1] marginTop:10] 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];
7275
}
7376

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

Example/PinLayoutSample/UI/Examples/SafeArea/SafeAreaView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class SafeAreaView: UIView {
6262

6363
topTextLabel.pin.top(pin.safeArea.top + 10).hCenter()
6464
iconImageView.pin.hCenter().vCenter(-10%)
65-
textLabel.pin.below(of: iconImageView).hCenter().width(60%).maxWidth(400).sizeToFit(.width).marginTop(20)
65+
textLabel.pin.below(of: iconImageView).hCenter().width(60%).maxWidth(400).marginTop(20).sizeToFit(.width)
6666
scanButton.pin.bottom(pin.safeArea.bottom + 5).hCenter().width(80%).maxWidth(300).height(40)
6767
}
6868
}

Example/PinLayoutSample/UI/Examples/TableViewExample/Cells/MethodCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class MethodCell: UITableViewCell {
6060
}
6161

6262
private func layout() {
63-
iconImageView.pin.top().left().size(30).margin(padding)
63+
iconImageView.pin.topLeft(padding).size(30)
6464
nameLabel.pin.after(of: iconImageView, aligned: .center).right().marginHorizontal(padding).sizeToFit(.width)
6565
descriptionLabel.pin.below(of: [iconImageView, nameLabel]).horizontally().margin(padding).sizeToFit(.width)
6666
}

0 commit comments

Comments
 (0)