I am creating a UIActivityViewController and trying to change its text color after clicking on the sharing message icon.
By default, I set the colors of the text in the navigation bar to white AppDelegateas follows.
UINavigationBar.appearance().tintColor = whiteColor
UIBarButtonItem.appearance().tintColor = whiteColor
However, only for the UIActivityViewController I want to set it by default (ie. Black title and blue button " Cancel).
I tried the following to get out of luck:
let shareText = "text to share"
let activityViewController = UIActivityViewController(activityItems: [shareText], applicationActivities: [])
activityViewController.navigationController?.navigationBar.tintColor = UIColor.black
activityViewController.navigationController?.navigationItem.rightBarButtonItem?.tintColor = UIColor.blue
present(activityViewController, animated: true, completion: nil)
The result is still the same with white text:
If you carefully look at the image, the navigation bar will have white text in the title bar and buttons of the right panel.

source
share