Don't set title for profile-screen when modal (IOS-157)

aka when account-suggestion-screen
This commit is contained in:
Nathan Mattes 2023-05-23 12:28:00 +02:00
parent e20b2e4e11
commit 2b59def31e
3 changed files with 11 additions and 12 deletions

View File

@ -280,8 +280,6 @@ extension ProfileHeaderViewController {
}
func updateHeaderScrollProgress(_ progress: CGFloat, throttle: CGFloat) {
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s: progress: %.2f", ((#file as NSString).lastPathComponent), #line, #function, progress)
// set title view offset
let nameTextFieldInWindow = profileHeaderView.nameTextField.superview!.convert(profileHeaderView.nameTextField.frame, to: nil)
let nameTextFieldTopToNavigationBarBottomOffset = containerSafeAreaInset.top - nameTextFieldInWindow.origin.y

View File

@ -289,6 +289,12 @@ extension ProfileViewController {
bindPager()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.navigationBar.prefersLargeTitles = false
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
@ -374,7 +380,7 @@ extension ProfileViewController {
profileHeaderViewController.profileHeaderView.viewModel.$name
.receive(on: DispatchQueue.main)
.sink { [weak self] name in
guard let self = self else { return }
guard let self = self, isModal == false else { return }
self.navigationItem.title = name
}
.store(in: &disposeBag)

View File

@ -33,10 +33,6 @@ class SuggestionAccountViewController: UIViewController, NeedsDependency {
}()
override func viewDidLoad() {
setupNavigationBarAppearance()
defer { setupNavigationBarBackgroundView() }
super.viewDidLoad()
title = L10n.Scene.SuggestionAccount.title
@ -63,13 +59,14 @@ class SuggestionAccountViewController: UIViewController, NeedsDependency {
view.backgroundColor = .secondarySystemBackground
tableView.backgroundColor = .secondarySystemBackground
navigationController?.navigationBar.prefersLargeTitles = true
navigationItem.largeTitleDisplayMode = .always
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.navigationBar.prefersLargeTitles = true
navigationItem.largeTitleDisplayMode = .automatic
tableView.deselectRow(with: transitionCoordinator, animated: animated)
}
@ -124,5 +121,3 @@ extension SuggestionAccountViewController: SuggestionAccountTableViewFooterDeleg
viewModel.followAllSuggestedAccounts(self)
}
}
extension SuggestionAccountViewController: OnboardingViewControllerAppearance { }