sparrowcode / PermissionsKit

Universal API for request permission and get its statuses.
https://x.com/sparrowcode_ios
MIT License
5.64k stars 462 forks source link

How to change alert background color #162

Closed Sargis closed 4 years ago

Sargis commented 4 years ago

I want change alert background color white to red (for example) I am using swift with version 5

Thanks

ivanvorobei commented 4 years ago

Before presenting you create object of controller. Change color in property view if it controller.

Sargis commented 4 years ago

sorry but I want change alert dialog background color,

ivanvorobei commented 4 years ago

Maybe dialog? Alert it simple UIAlertController.

Sargis commented 4 years ago

right, dialod

ivanvorobei commented 4 years ago

Dialog it simple controller with table. See view hierarchy and change view color property.

Sargis commented 4 years ago

so I Need change tableview background Color, not Alert's superview Color:

there is my example

let controller = SPPermissions.dialog([ .notification, .camera]) controller.dialogView.backgroundColor = .red

but this is not work :(

ivanvorobei commented 4 years ago

Please, check code of this controller. controller.dialogView.backgroundColor = .red shouldn't work, because viewDidLoad call after it.

Sargis commented 4 years ago

so How Can I change dialogView Color?

ср, 25 дек. 2019 г. в 16:03, Ivan Vorobei notifications@github.com:

Please, check code of this controller. controller.dialogView.backgroundColor = .red shouldn't work, because viewDidLoad call after it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ivanvorobei/SPPermissions/issues/162?email_source=notifications&email_token=AC3RGFLWGENVSE6G55AETULQ2NDYTA5CNFSM4J7EID52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHUJTFI#issuecomment-568891797, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3RGFNTTCNXARPIU53VAQLQ2NDYTANCNFSM4J7EID5Q .

ivanvorobei commented 4 years ago

The controller does not currently support custom color out of the box. There are life hacks to help you do this. Call the color setting after ViewDidLoad, no matter what way.

Sargis commented 4 years ago

okay thanks, so I need change color from your framework code, I think it is bug :)

Thank you

ivanvorobei commented 4 years ago

It not bug. Please, check lifecycle of controller. init call before viewDidLoad.