Post

Replies

Boosts

Views

Activity

largeTitleDisplayMode doesn't work when using UIHostingController
When using a UIHostingController to host my SwiftUI content, I can't get the navigation title to start large and shift to inline as the user scrolls. Is this a known problem with using the UIHostingController? var viewModel: DashboardViewModel! lazy var contentView = UIHostingController(rootView: DashboardView(viewModel: viewModel)) override func viewDidLoad() { super.viewDidLoad() addChild(contentView) view.addSubview(contentView.view) setupConstraints() navigationItem.title = "Test Title" navigationItem.largeTitleDisplayMode = .automatic } The title in the navigation controller shows inline
4
1
2.0k
Apr ’23