I am creating a UIActivityViewController and trying to change its text color after tapping the share messages icon.
By default, I set my navigation bar text colors to white in the AppDelegate
like so
UINavigationBar.appearance().tintColor = whiteColor
UIBarButtonItem.appearance().tintColor = whiteColor
However for just the UIActivityViewController I want to make it the default (i.e. black title text, and the blue Cancel
button)
I have tried the following to no 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 look closely in the image, the navigation bar has white text in the title and right bar button items.