1

I'm pushing to a navigation controller and the large title I have set within the shootSummary VC text attributes change without warning -- they lose their original formatting. So I've tried putting them as I've done here after the push, but that hasn't worked either. Here's my code:

guard let shootSummaryVC = storyboard?.instantiateViewController(withIdentifier: "ShootPVC") as? ShootPVC else { return }
guard let indexPath = tableView.indexPathForSelectedRow else { return }
guard let shootID = shoots?[indexPath.row].id else { return }
shootSummaryVC.id = shootID
shootSummaryVC.initialPage = 3
        
DispatchQueue.main.async { [self] in

    navigationController?.pushViewController(shootSummaryVC, animated: true)
    navigationController?.hidesNavigationBarHairline = true
    navigationController?.navigationBar.topItem?.backBarButtonItem =
    UIBarButtonItem(title: "Track Payments", style: .plain, target: nil, action: nil)
    let p = NSMutableParagraphStyle()
    p.firstLineHeadIndent = 10
    navigationController?.navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.font: currentTheme.titleFontLarge, NSAttributedString.Key.foregroundColor: currentTheme.navigationBarTextColor, NSAttributedString.Key.paragraphStyle: p]

}

The largeTitleTextAttributes in my attempted solution above don't affect the title. I tried setting them within the VC being pushed to (shootSummaryVC) but that hasn't worked either. Any ideas?

  • why you create a mess while pushing? You should create custom navigation controller with large title text give navigationBar.largeTitleTextAttributes on its view did load and the embed your controllers with that navigation controller – Zeeshan Ahmad II Jul 29 '22 at 04:08
  • https://stackoverflow.com/questions/72595298/uinavigationbar-large-title-doesnt-appear-when-scroll-view-up/72602819#72602819 here is my code of custom navigation controller – Zeeshan Ahmad II Jul 29 '22 at 04:09
  • As I mentioned in the post, I already did that and it doesn't work. – MischkaTheBear Jul 29 '22 at 04:28

0 Answers0