Skip to content

Commit 236c6d7

Browse files
committed
Reorder initializer parameters.
1 parent 54ecef2 commit 236c6d7

9 files changed

+40
-64
lines changed

LimaTest/GridAlignmentViewController.swift

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,38 +32,32 @@ class GridAlignmentViewController: UIViewController {
3232
// Baselines
3333
LMColumnView(isAlignToGrid: true,
3434
LMRowView(isAlignToBaseline: true,
35-
UILabel(text: "First Baseline", textAlignment: .right,
36-
with: cellStyle),
37-
38-
LMColumnView(weight: 1,
39-
UILabel(text: text, numberOfLines: 0),
35+
UILabel(text: "First Baseline", textAlignment: .right, with: cellStyle),
36+
37+
LMColumnView(weight: 1, with: cellStyle,
4038
UILabel(text: text, numberOfLines: 0),
41-
with: cellStyle
39+
UILabel(text: text, numberOfLines: 0)
4240
)
4341
),
4442

4543
LMRowView(isAlignToBaseline: true, baseline: .last,
46-
UILabel(text: "Last Baseline", textAlignment: .right,
47-
with: cellStyle),
44+
UILabel(text: "Last Baseline", textAlignment: .right, with: cellStyle),
4845

49-
LMColumnView(weight: 1,
50-
UILabel(text: text, numberOfLines: 0),
46+
LMColumnView(weight: 1, with: cellStyle,
5147
UILabel(text: text, numberOfLines: 0),
52-
with: cellStyle
48+
UILabel(text: text, numberOfLines: 0)
5349
)
5450
)
5551
),
5652

5753
// Weights
5854
LMRowView(
59-
LMColumnView(weight: 2,
55+
LMColumnView(weight: 2, with: cellStyle,
6056
UILabel(text: text, numberOfLines: 0),
61-
LMSpacer(),
62-
with: cellStyle
57+
LMSpacer()
6358
),
6459

65-
UILabel(text: text, numberOfLines: 0, weight: 1,
66-
with: cellStyle)
60+
UILabel(text: text, numberOfLines: 0, weight: 1, with: cellStyle)
6761
)
6862
)
6963
)

LimaTest/HorizontalAlignmentViewController.swift

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,61 +31,55 @@ class HorizontalAlignmentViewController: UIViewController {
3131
// Leading alignment
3232
UILabel(text: "Leading", font: .systemFont(ofSize: 14)),
3333

34-
LMRowView(margin: 8, horizontalAlignment: .leading,
34+
LMRowView(margin: 8, horizontalAlignment: .leading, with: cellStyle,
3535
UIImageView(image: phoneIcon, tintColor: .black),
3636
UIImageView(image: faxIcon, tintColor: .black),
37-
UIImageView(image: emailIcon, tintColor: .black),
38-
with: cellStyle
37+
UIImageView(image: emailIcon, tintColor: .black)
3938
),
4039

41-
LMColumnView(margin: 8, horizontalAlignment: .leading,
40+
LMColumnView(margin: 8, horizontalAlignment: .leading, with: cellStyle,
4241
UIImageView(image: phoneIcon, tintColor: .black),
4342
UIImageView(image: faxIcon, tintColor: .black),
44-
UIImageView(image: emailIcon, tintColor: .black),
45-
with: cellStyle
43+
UIImageView(image: emailIcon, tintColor: .black)
4644
),
4745

4846
LMSpacer(height: 0.5, backgroundColor: .gray),
4947

5048
// Trailing alignment
5149
UILabel(text: "Trailing", font: .systemFont(ofSize: 14)),
5250

53-
LMRowView(margin: 8, horizontalAlignment: .trailing,
51+
LMRowView(margin: 8, horizontalAlignment: .trailing, with: cellStyle,
5452
UIImageView(image: phoneIcon, tintColor: .black),
5553
UIImageView(image: faxIcon, tintColor: .black),
56-
UIImageView(image: emailIcon, tintColor: .black),
57-
with: cellStyle
54+
UIImageView(image: emailIcon, tintColor: .black)
5855
),
5956

60-
LMColumnView(margin: 8, horizontalAlignment: .trailing,
57+
LMColumnView(margin: 8, horizontalAlignment: .trailing, with: cellStyle,
6158
UIImageView(image: phoneIcon, tintColor: .black),
6259
UIImageView(image: faxIcon, tintColor: .black),
63-
UIImageView(image: emailIcon, tintColor: .black),
64-
with: cellStyle
60+
UIImageView(image: emailIcon, tintColor: .black)
6561
),
6662

6763
LMSpacer(height: 0.5, backgroundColor: .gray),
6864

6965
// Center alignment
7066
UILabel(text: "Center", font: .systemFont(ofSize: 14)),
7167

72-
LMColumnView(margin: 8, horizontalAlignment: .center,
68+
LMColumnView(margin: 8, horizontalAlignment: .center, with: cellStyle,
7369
UIImageView(image: phoneIcon, tintColor: .black),
7470
UIImageView(image: faxIcon, tintColor: .black),
75-
UIImageView(image: emailIcon, tintColor: .black),
76-
with: cellStyle
71+
UIImageView(image: emailIcon, tintColor: .black)
7772
),
7873

7974
LMSpacer(height: 0.5, backgroundColor: .gray),
8075

8176
// Fill alignment
8277
UILabel(text: "Fill", font: .systemFont(ofSize: 14)),
8378

84-
LMRowView(margin: 8, horizontalAlignment: .fill,
79+
LMRowView(margin: 8, horizontalAlignment: .fill, with: cellStyle,
8580
UIImageView(image: phoneIcon, contentMode: .center, tintColor: .black, weight: 1),
8681
UIImageView(image: faxIcon, contentMode: .center, tintColor: .black, weight: 1),
87-
UIImageView(image: emailIcon, contentMode: .center, tintColor: .black, weight: 1),
88-
with: cellStyle
82+
UIImageView(image: emailIcon, contentMode: .center, tintColor: .black, weight: 1)
8983
)
9084
)
9185
)

LimaTest/VerticalAlignmentViewController.swift

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,16 @@ class VerticalAlignmentViewController: UIViewController {
3333
UILabel(text: "Top", font: .systemFont(ofSize: 14)),
3434

3535
LMRowView(weight: 1,
36-
LMColumnView(margin: 8, verticalAlignment: .top,
36+
LMColumnView(margin: 8, verticalAlignment: .top, with: cellStyle,
3737
UIImageView(image: phoneIcon, tintColor: .black),
3838
UIImageView(image: faxIcon, tintColor: .black),
39-
UIImageView(image: emailIcon, tintColor: .black),
40-
with: cellStyle
39+
UIImageView(image: emailIcon, tintColor: .black)
4140
),
4241

43-
LMRowView(margin: 8, verticalAlignment: .top,
42+
LMRowView(margin: 8, verticalAlignment: .top, with: cellStyle,
4443
UIImageView(image: phoneIcon, tintColor: .black),
4544
UIImageView(image: faxIcon, tintColor: .black),
46-
UIImageView(image: emailIcon, tintColor: .black),
47-
with: cellStyle
45+
UIImageView(image: emailIcon, tintColor: .black)
4846
)
4947
)
5048
),
@@ -56,18 +54,16 @@ class VerticalAlignmentViewController: UIViewController {
5654
UILabel(text: "Bottom", font: .systemFont(ofSize: 14)),
5755

5856
LMRowView(weight: 1,
59-
LMColumnView(margin: 8, verticalAlignment: .bottom,
57+
LMColumnView(margin: 8, verticalAlignment: .bottom, with: cellStyle,
6058
UIImageView(image: phoneIcon, tintColor: .black),
6159
UIImageView(image: faxIcon, tintColor: .black),
62-
UIImageView(image: emailIcon, tintColor: .black),
63-
with: cellStyle
60+
UIImageView(image: emailIcon, tintColor: .black)
6461
),
6562

66-
LMRowView(margin: 8, verticalAlignment: .bottom,
63+
LMRowView(margin: 8, verticalAlignment: .bottom, with: cellStyle,
6764
UIImageView(image: phoneIcon, tintColor: .black),
6865
UIImageView(image: faxIcon, tintColor: .black),
69-
UIImageView(image: emailIcon, tintColor: .black),
70-
with: cellStyle
66+
UIImageView(image: emailIcon, tintColor: .black)
7167
)
7268
)
7369
),
@@ -78,11 +74,10 @@ class VerticalAlignmentViewController: UIViewController {
7874
LMColumnView(
7975
UILabel(text: "Center", font: .systemFont(ofSize: 14)),
8076

81-
LMRowView(margin: 8, verticalAlignment: .center, weight: 1,
77+
LMRowView(margin: 8, verticalAlignment: .center, weight: 1, with: cellStyle,
8278
UIImageView(image: phoneIcon, tintColor: .black),
8379
UIImageView(image: faxIcon, tintColor: .black),
84-
UIImageView(image: emailIcon, tintColor: .black),
85-
with: cellStyle
80+
UIImageView(image: emailIcon, tintColor: .black)
8681
)
8782
),
8883

@@ -92,11 +87,10 @@ class VerticalAlignmentViewController: UIViewController {
9287
LMColumnView(
9388
UILabel(text: "Fill", font: .systemFont(ofSize: 14)),
9489

95-
LMColumnView(margin: 8,
90+
LMColumnView(margin: 8, with: cellStyle,
9691
UIImageView(image: phoneIcon, contentMode: .center, tintColor: .black, weight: 1),
9792
UIImageView(image: faxIcon, contentMode: .center, tintColor: .black, weight: 1),
98-
UIImageView(image: emailIcon, contentMode: .center, tintColor: .black, weight: 1),
99-
with: cellStyle
93+
UIImageView(image: emailIcon, contentMode: .center, tintColor: .black, weight: 1)
10094
)
10195
)
10296
)

Sources/Lima/LMAnchorView.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ public extension LMAnchorView {
2323
backgroundColor: UIColor? = nil,
2424
weight: CGFloat = .nan,
2525
anchor: LMAnchor = [],
26-
_ subviews: UIView...,
27-
with: ((LMAnchorView) -> Void) = { _ in }) {
26+
with: ((LMAnchorView) -> Void) = { _ in }, _ subviews: UIView...) {
2827
self.init(margin: margin,
2928
topMargin: topMargin,
3029
leadingMargin: leadingMargin,

Sources/Lima/LMColumnView.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ public extension LMColumnView {
2727
backgroundColor: UIColor? = nil,
2828
weight: CGFloat = .nan,
2929
anchor: LMAnchor = [],
30-
_ subviews: UIView...,
31-
with: ((LMColumnView) -> Void) = { _ in }) {
30+
with: ((LMColumnView) -> Void) = { _ in }, _ subviews: UIView...) {
3231
self.init(margin: margin,
3332
topMargin: topMargin,
3433
leadingMargin: leadingMargin,

Sources/Lima/LMRowView.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ public extension LMRowView {
2828
backgroundColor: UIColor? = nil,
2929
weight: CGFloat = .nan,
3030
anchor: LMAnchor = [],
31-
_ subviews: UIView...,
32-
with: ((LMRowView) -> Void) = { _ in }) {
31+
with: ((LMRowView) -> Void) = { _ in }, _ subviews: UIView...) {
3332
self.init(margin: margin,
3433
topMargin: topMargin,
3534
leadingMargin: leadingMargin,

Sources/Lima/LMScrollView.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ public extension LMScrollView {
1919
backgroundColor: UIColor? = nil,
2020
weight: CGFloat = .nan,
2121
anchor: LMAnchor = [],
22-
_ content: UIView? = nil,
23-
with: ((LMScrollView) -> Void) = { _ in }) {
22+
with: ((LMScrollView) -> Void) = { _ in }, _ content: UIView? = nil) {
2423
self.init()
2524

2625
self.isFitToWidth = isFitToWidth

Sources/Lima/LMTableViewCell.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ import UIKit
1717
public extension LMTableViewCell {
1818
convenience init(accessoryType: UITableViewCell.AccessoryType = .none,
1919
selectionStyle: UITableViewCell.SelectionStyle = .blue,
20-
_ content: UIView? = nil,
21-
with: ((LMTableViewCell) -> Void) = { _ in }) {
20+
with: ((LMTableViewCell) -> Void) = { _ in }, _ content: UIView? = nil) {
2221
self.init()
2322

2423
setContent(content, ignoreMargins: false)

Sources/Lima/LMTableViewHeaderFooterView.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
import UIKit
1616

1717
public extension LMTableViewHeaderFooterView {
18-
convenience init(_ content: UIView? = nil,
19-
with: ((LMTableViewHeaderFooterView) -> Void) = { _ in }) {
18+
convenience init(with: ((LMTableViewHeaderFooterView) -> Void) = { _ in }, _ content: UIView? = nil) {
2019
self.init()
2120

2221
setContent(content, ignoreMargins: false)

0 commit comments

Comments
 (0)