File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -54,18 +54,14 @@ 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
6157 child. view. autoresizingMask = [ . flexibleWidth, . flexibleHeight]
58+ child. view. translatesAutoresizingMaskIntoConstraints = false
59+ childWidget = child
6260
63- if let childController = child . controller , childController . parent == nil {
64- addChild ( childController )
65- childController . didMove ( toParent : self )
61+ // Force layout immediately if view already has bounds
62+ if view . bounds != . zero {
63+ child . view . frame = view . bounds
6664 }
67-
68- childWidget = child
6965 }
7066
7167 override func viewDidLayoutSubviews( ) {
You can’t perform that action at this time.
0 commit comments