Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PrefersLargeTitle won't work using InterfaceBuilderControllerContainer #2

Closed
muizidn opened this issue Feb 2, 2020 · 2 comments
Closed
Labels
bug Something isn't working question Further information is requested wontfix This will not be worked on

Comments

@muizidn
Copy link
Owner

muizidn commented Feb 2, 2020

protocol InterfaceBuilderControllerContainer: UIViewController {
    associatedtype XibController: InterfaceBuilderController
}

extension InterfaceBuilderControllerContainer {
    var xibController: XibController {
        children.first(where: { $0 is XibController }) as! XibController
    }
    
    init(withXib: Bool) {
        self.init()
        let vc = XibController.create()
        addChild(vc)
        view.add(vc.view) { v in
            v.flex.grow(1)
        }
        vc.didMove(toParent: self)
    }
}
@muizidn muizidn added bug Something isn't working question Further information is requested labels Feb 2, 2020
@muizidn
Copy link
Owner Author

muizidn commented Feb 2, 2020

This protocol will synthesise capability of conforming controller to layout using child interface builder information. But it seems, something strange happens. If we use this protocol initialiser over BaseController convenience one, then prefersLargeTitles won't work.

Investigating....

@muizidn
Copy link
Owner Author

muizidn commented Feb 2, 2020

Actually this also introduces new issue.

The initialiser will invoke loadView -> viewDidLayout -> startBind which causes crash because viewModel is uninitialised yet.

@muizidn muizidn added the wontfix This will not be worked on label Feb 3, 2020
@muizidn muizidn closed this as completed Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant