Hi @seanmp
I was able to update the navigation bar if the AVMediaSelectionTableViewController using an extension class of UINavigationController. Please see code used below:
Code Block open override func viewDidLayoutSubviews() { |
let subtitleViewController: AnyClass? = NSClassFromString("AVMediaSelectionTableViewController") |
for childVC in self.viewControllers { |
if let subtitleViewController = subtitleViewController, childVC.isKind(of: subtitleViewController) { |
var normalTitleTextAttributes = childVC.navigationItem.rightBarButtonItem?.titleTextAttributes(for: .normal) |
var highlightedTitleTextAttributes = childVC.navigationItem.rightBarButtonItem?.titleTextAttributes(for: .highlighted) |
var disabledTitleTextAttributes = childVC.navigationItem.rightBarButtonItem?.titleTextAttributes(for: .disabled) |
normalTitleTextAttributes?[NSAttributedString.Key.foregroundColor] = UIColor.black |
highlightedTitleTextAttributes?[NSAttributedString.Key.foregroundColor] = UIColor.black |
disabledTitleTextAttributes?[NSAttributedString.Key.foregroundColor] = UIColor.black |
childVC.navigationItem.rightBarButtonItem?.setTitleTextAttributes(normalTitleTextAttributes, for: .normal) |
childVC.navigationItem.rightBarButtonItem?.setTitleTextAttributes(highlightedTitleTextAttributes, for: .highlighted) |
childVC.navigationItem.rightBarButtonItem?.setTitleTextAttributes(disabledTitleTextAttributes, for: .disabled) |
break |
} |
} |
} |