Skip to content

Commit 8642b54

Browse files
author
JWI
committed
something has GOT to give oml
1 parent e946e7b commit 8642b54

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
@@ -54,14 +54,18 @@ final class RootViewController: UIViewController {
5454
child.removeFromParentWidget()
5555

5656
view.addSubview(child.view)
57+
child.view.backgroundColor = .red
58+
child.view.isHidden = false
59+
child.view.alpha = 1
60+
child.view.frame = view.bounds
5761
child.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
58-
child.view.translatesAutoresizingMaskIntoConstraints = false
59-
childWidget = child
6062

61-
// Force layout immediately if view already has bounds
62-
if view.bounds != .zero {
63-
child.view.frame = view.bounds
63+
if let childController = child.controller, childController.parent == nil {
64+
addChild(childController)
65+
childController.didMove(toParent: self)
6466
}
67+
68+
childWidget = child
6569
}
6670

6771
override func viewDidLayoutSubviews() {

0 commit comments

Comments
 (0)