Skip to content

Commit df0d985

Browse files
committed
Uses the latest IBKit 0.2.0 (@ IBKitExample)
1 parent 3ca9d7a commit df0d985

File tree

4 files changed

+7
-22
lines changed

4 files changed

+7
-22
lines changed

Example-iOS/IBKitExample-iOS/IBKitExample-iOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"repositoryURL": "https://github.com/IBCodeKit/IBKit.git",
77
"state": {
88
"branch": null,
9-
"revision": "4404c3229c06ea371f0dc34c34b0e149234f9ec2",
10-
"version": "0.1.0"
9+
"revision": "3ca9d7a5ee6ef69b8c94c3565fb12570e8a563cc",
10+
"version": "0.2.0"
1111
}
1212
},
1313
{

Example-iOS/IBKitExample-iOS/IBKitExample-iOS/PriceView.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,6 @@ class PriceView: UIView, InterfaceBuilder {
3434
return CGSize(width: max(costSize.width, originalCostSize.width), height: surgingTextSize.height + costSize.height + originalCostSize.height + 2)
3535
}
3636

37-
override init(frame: CGRect) {
38-
super.init(frame: frame)
39-
build()
40-
}
41-
42-
required init?(coder: NSCoder) {
43-
super.init(coder: coder)
44-
build()
45-
}
46-
4737
var body: Interface {
4838
ViewGroup {
4939
UILabel()
@@ -115,7 +105,7 @@ struct PriceView_Preview: PreviewProvider {
115105
].compactMap { $0 }
116106

117107
return ForEach(costs, content: { (price) -> Preview in
118-
let priceView = PriceView()
108+
let priceView = PriceView.loadFromIB()
119109
priceView.price = price
120110
return Preview(view: priceView)
121111
})

Example-iOS/IBKitExample-iOS/IBKitExample-iOS/RideEstimationView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class RideEstimationView: UIView, InterfaceBuilder {
124124
maker.width.equalTo(50).priority(.low)
125125
}
126126

127-
PriceView()
127+
PriceView.loadFromIB()
128128
.assign(to: \Self.priceView, on: self)
129129
.makeConstraints { (maker, views) in
130130
maker.trailing.centerY.equalToSuperview()

Example-iOS/IBKitExample-iOS/IBKitExample-iOS/ViewController.swift

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,13 @@ class ViewController: UIViewController, InterfaceBuilder {
1919
}
2020

2121
for e in estimations ?? [] {
22-
let view = RideEstimationView()
22+
let view = RideEstimationView.loadFromIB()
2323
view.estimation = e
2424
stackView.addArrangedSubview(view)
2525
}
2626
}
2727
}
2828

29-
override func viewDidLoad() {
30-
super.viewDidLoad()
31-
build()
32-
estimations = decode(from: "ride_estimations")
33-
}
34-
3529
var body: Interface {
3630
view.backgroundColor = .systemBackground
3731
return ViewGroup {
@@ -68,7 +62,8 @@ import SwiftUI
6862
struct ViewController_Preview: PreviewProvider {
6963
static var previews: some View {
7064

71-
let vc = ViewController()
65+
let vc = ViewController.loadFromIB()
66+
vc.estimations = decode(from: "ride_estimations")
7267
return Preview(viewController: vc)
7368
.environment(\.colorScheme, .light)
7469
}

0 commit comments

Comments
 (0)