Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Commit 7ed579f

Browse files
authored
Making LOKLayout configureView method non-optional (#225)
There have been several issues where the configure method was not implemented or implemented with slightly wrong signature, so we’re making it non-optional.
1 parent 1a5f86b commit 7ed579f

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

LayoutKitObjCSampleApp/RotationLayout.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ - (nonnull UIView *)makeView {
5050
return [[RotationView alloc] init];
5151
}
5252

53+
- (void)configureView:(UIView *)view {
54+
55+
}
56+
5357
- (nonnull LOKLayoutMeasurement *)measurementWithin:(CGSize)maxSize {
5458
LOKLayoutMeasurement *sublayoutMeasurement = [self.sublayout measurementWithin:maxSize];
5559
CGSize rotatedSize = CGSizeMake(sublayoutMeasurement.size.height, sublayoutMeasurement.size.width);

Sources/ObjCSupport/Internal/ReverseWrappedLayout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ReverseWrappedLayout: Layout {
2727
}
2828

2929
func configure(baseTypeView: View) {
30-
layout.configureView?(baseTypeView)
30+
layout.configureView(baseTypeView)
3131
}
3232

3333
var flexibility: Flexibility {

Sources/ObjCSupport/Internal/WrappedLayout.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class WrappedLayout: LOKLayout {
2828
return layout.makeView()
2929
}
3030

31-
func configure(baseTypeView: View) {
32-
layout.configure(baseTypeView: baseTypeView)
31+
func configureView(_ view: View) {
32+
layout.configure(baseTypeView: view)
3333
}
3434

3535
var flexibility: LOKFlexibility {

Sources/ObjCSupport/LOKBaseLayout.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ open class LOKBaseLayout: NSObject, LOKLayout {
4141
return layout.makeView()
4242
}
4343

44-
open func configure(baseTypeView: View) {
45-
layout.configure(baseTypeView: baseTypeView)
44+
open func configureView(_ view: View) {
45+
layout.configure(baseTypeView: view)
4646
}
4747

4848
public var flexibility: LOKFlexibility {

Sources/ObjCSupport/LOKLayout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import CoreGraphics
1313
@objc func arrangement(within rect: CGRect, measurement: LOKLayoutMeasurement) -> LOKLayoutArrangement
1414
@objc var needsView: Bool { get }
1515
@objc func makeView() -> View
16-
@objc optional func configureView(_ view: View)
16+
@objc func configureView(_ view: View)
1717
@objc var flexibility: LOKFlexibility { get }
1818
@objc var viewReuseId: String? { get }
1919
}

0 commit comments

Comments
 (0)