Reputation: 3036
I am using google sign in for my swift application. When the user clicks to sign in the API gives this UIAlert
. Is there any way to change the tint colour of this? I.e. the "Cancel" & "Continue"?
I have even tried to change it globally using AppDelegate code below;
UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = Color.brandPurple
This has no effect.
Upvotes: 3
Views: 759
Reputation: 119128
You have two options, (And duo to the name of the color you used and method you already tried, probably first option is what you are looking for)
you can change the window
's tintColor
it could be accessed from any view
view.window?.tintColor = Color.brandPurple
Change that single alert's view's tintColor
alertController.view.tintColor = Color.brandPurple
Upvotes: 1
Reputation: 2252
Just set tintColor of UIAlertController.
alertController.view.tintColor = Color.brandPurple // alertController is the object of UIAlertController
Upvotes: 5