Fix title view for orientation

This commit is contained in:
ismailgulek
2021-11-22 18:01:29 +03:00
parent ea2bc4b67f
commit 00fdac165a
@@ -89,7 +89,11 @@ final class ThreadListViewController: UIViewController {
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
guard let titleView = self.titleView else { return }
titleView.updateLayout(for: UIApplication.shared.statusBarOrientation)
if UIApplication.shared.statusBarOrientation.isPortrait {
titleView.updateLayout(for: .landscapeLeft)
} else {
titleView.updateLayout(for: .portrait)
}
}
// MARK: - Private
@@ -122,6 +126,7 @@ final class ThreadListViewController: UIViewController {
let titleView = ThreadRoomTitleView.loadFromNib()
titleView.mode = .allThreads
titleView.configure(withViewModel: viewModel.titleViewModel)
titleView.updateLayout(for: UIApplication.shared.statusBarOrientation)
self.titleView = titleView
navigationItem.leftItemsSupplementBackButton = true
vc_removeBackTitle()