Skip to content

Commit 6a7813a

Browse files
author
JWI
committed
just testing
1 parent c475bbc commit 6a7813a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Sources/UIKitBackend/UIKitBackend+Window.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,18 @@ final class RootViewController: UIViewController {
6060
child.removeFromParentWidget()
6161

6262
view.addSubview(child.view)
63+
child.view.backgroundColor = .red
64+
child.view.isHidden = false
65+
child.view.alpha = 1
66+
child.view.frame = view.bounds
6367
child.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
64-
child.view.translatesAutoresizingMaskIntoConstraints = false
65-
childWidget = child
6668

67-
// Force layout immediately if view already has bounds
68-
if view.bounds != .zero {
69-
child.view.frame = view.bounds
69+
if let childController = child.controller, childController.parent == nil {
70+
addChild(childController)
71+
childController.didMove(toParent: self)
7072
}
73+
74+
childWidget = child
7175
}
7276

7377
override func viewDidLayoutSubviews() {

0 commit comments

Comments
 (0)