Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to change color of navigation back button #65

Closed
vkcldhkd opened this issue Jan 16, 2019 · 3 comments
Closed

how to change color of navigation back button #65

vkcldhkd opened this issue Jan 16, 2019 · 3 comments
Labels

Comments

@vkcldhkd
Copy link

vkcldhkd commented Jan 16, 2019

Thanks for making a good library.
I want to change the color of the navigation back button. But it did not change.
Help me...

guard let openSourceVC = VTAcknowledgementsViewController.acknowledgementsViewController () else {return}
                
////// NOT CHANGE!!
openSourceVC.navigationController? .navigationBar.tintColor = .black
openSourceVC.navigationController? .navigationBar.barTintColor = .black
//////

openSourceVC.navigationItem.title = "SETTING_TEXT8" .localized ()
                
openSourceVC.headerText = ""
openSourceVC.footerText = ""
push (vc: openSourceVC)
@vtourraine
Copy link
Owner

Hello (and sorry for this late response 😅),

The problem in this code is that the VTAcknowledgementsViewController instance doesn’t have a navigation controller. So openSourceVC.navigationController? returns nil, and fails silently.

The fix would depend on your specific interface, but if the current view controller already has a navigation controller, it could be as simple as this:

self.navigationController?.navigationBar.tintColor = .black
self.navigationController?.navigationBar.barTintColor = .black

@vkcldhkd
Copy link
Author

My solution is to create a new ViewController!

  1. Get the acknowledgments from the AcknowledgeListViewController.
  2. binding Custom UI with acknowledgments
        let acknowListVC = AcknowListViewController()
        self.acknowledgements = acknowListVC.acknowledgements
        tableView.reloadData()

@vtourraine
Copy link
Owner

Glad to hear that you could find a suitable solution 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants