Skip to content

Commit 09b4645

Browse files
committed
Fix a few more things, oops
1 parent c0ff7a8 commit 09b4645

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Sources/UIKitBackend/UIKitBackend+Container.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ extension UIKitBackend {
112112
public func naturalSize(of widget: Widget) -> SIMD2<Int> {
113113
let size = widget.intrinsicContentSize
114114
return SIMD2(
115-
Int(size.width),
116-
Int(size.height)
115+
Int(size.width.rounded(.awayFromZero)),
116+
Int(size.height.rounded(.awayFromZero))
117117
)
118118
}
119119

Sources/UIKitBackend/UIKitBackend+Control.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ extension UIKitBackend {
254254
return textFieldWidget.child.text ?? ""
255255
}
256256

257-
#if os(iOS)
257+
#if os(iOS) && !targetEnvironment(macCatalyst)
258258
public func createPicker() -> Widget {
259259
PickerWidget()
260260
}
@@ -303,7 +303,7 @@ extension UIKitBackend {
303303
wrapper.onClick = handleClick
304304
}
305305

306-
#if os(iOS) || targetEnvironment(macCatalyst)
306+
#if os(iOS)
307307
public func createSlider() -> Widget {
308308
SliderWidget()
309309
}

Sources/UIKitBackend/UIKitBackend+Passive.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ extension UIKitBackend {
3636
}
3737

3838
public func createTextView() -> Widget {
39-
WrapperWidget<UILabel>()
39+
let widget = WrapperWidget<UILabel>()
40+
widget.child.numberOfLines = 0
41+
return widget
4042
}
4143

4244
public func updateTextView(

0 commit comments

Comments
 (0)