Skip to content

Commit ccd5854

Browse files
committed
Fix for support Swift5.0
1 parent 2345e52 commit ccd5854

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

Sources/AnyComponent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public struct AnyComponent: Component {
110110
/// - Returns: A `CGSize` value represents a natural size of the passed content.
111111
@inlinable
112112
public func intrinsicContentSize(for content: Any) -> CGSize {
113-
box.intrinsicContentSize(for: content)
113+
return box.intrinsicContentSize(for: content)
114114
}
115115

116116
/// Invoked every time of before a component got into visible area.

Sources/Component.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public extension Component where Content: UIView {
207207
///
208208
/// - Returns: A `CGSize` value represents a natural size of the passed content.
209209
func intrinsicContentSize(for content: Content) -> CGSize {
210-
content.intrinsicContentSize
210+
return content.intrinsicContentSize
211211
}
212212
}
213213

@@ -229,7 +229,7 @@ public extension Component where Content: UIViewController {
229229
///
230230
/// - Returns: A `CGSize` value represents a natural size of the passed content.
231231
func intrinsicContentSize(for content: Content) -> CGSize {
232-
content.view.intrinsicContentSize
232+
return content.view.intrinsicContentSize
233233
}
234234
}
235235

Sources/ComponentWrapper/ComponentWrapping.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public extension ComponentWrapping {
122122
///
123123
/// - Returns: A `CGSize` value represents a natural size of the passed content.
124124
func intrinsicContentSize(for content: Wrapped.Content) -> CGSize {
125-
wrapped.intrinsicContentSize(for: content)
125+
return wrapped.intrinsicContentSize(for: content)
126126
}
127127

128128
/// Invoked every time of before a component got into visible area.

Tests/AnyComponentTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ final class AnyComponentTests: XCTestCase {
6969
func testIntrinsicContentSizeForView() {
7070
struct TestComponent: Component {
7171
func renderContent() -> UILabel {
72-
UILabel()
72+
return UILabel()
7373
}
7474

7575
func render(in content: UILabel) {

Tests/ComponentTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class ComponentTests: XCTestCase {
2525
func testIntrinsicContentSizeForView() {
2626
struct TestComponent: Component {
2727
func renderContent() -> UILabel {
28-
UILabel()
28+
return UILabel()
2929
}
3030

3131
func render(in content: UILabel) {

Tests/TestTools.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class MockComponent: Component, Equatable {
107107
}
108108

109109
func intrinsicContentSize(for content: UIView) -> CGSize {
110-
intrinsicContentSize
110+
return intrinsicContentSize
111111
}
112112

113113
func contentWillDisplay(_ content: UIView) {

0 commit comments

Comments
 (0)