Change UIActivityViewController Edit button color

248 Views Asked by At

I'd like to change the color of the Edit Actions... button at the very bottom of the UIActivityViewController.

let activityViewController = UIActivityViewController(activityItems: items,
                                                      applicationActivities: nil)

This is what I was sure would be working, but it didn't:

activityViewController.view.tintColor = .green

These were further attempts. None worked as desired. The color didn't change.

activityViewController.navigationController?.navigationBar.tintColor = .green
activityViewController.tabBarController?.view.tintColor = .green
activityViewController.presentingViewController?.view.tintColor = .green
activityViewController.editButtonItem.tintColor = .green

What am I missing?

Neither SO, nor Google could help.

1

There are 1 best solutions below

1
Varsha Shivhare On

Please try to use below code while presenting activityViewController, I hope it works.

self.present(activityViewController, animated: true, completion: { () in
    UIBarButtonItem.appearance().tintColor = UIColor.systemBlue
    UINavigationBar.appearance().barTintColor = UIColor.white
})