Skip to content

MSFNavigationBar does not update the title on the same instance unless titleView is reset. #1968

@ychung25

Description

@ychung25

MSFNavigationBar does not update the title on the same instance unless titleView is reset.
NavigationBar.Swift :: updateSubtitleView, it checks for navigationItem.titleView == nil and returns without setting navigationItem.titleView = customTitleView.

So without setting viewController.navigationItem.titleView to nil, the following code will not update the navbar title on the same instance of viewController if it was run once before.

viewController.title = "My Custom Title"
navigationController?.pushViewController(viewController, animated: true)

Please look into fixing this. If this is there for a reason for this behaviuor, please expose an API that allows to set navbar title without having set viewController.navigationItem.titleView = nil

Environment Information

  • Platform:
    • [ x] iOS
    • macOS

Please provide a reproduction of the bug:

Explained above.

Priorities and help requested:

Are you willing to submit a PR to fix? (Yes, No)
No

Requested priority: (Blocking, High, Normal, Low)
Low

Products/applications affected: (if applicable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions