nickoneill / PermissionScope

Intelligent iOS permissions UI and unified API
MIT License
4.84k stars 506 forks source link

Customize alerts #172

Open akofman opened 8 years ago

akofman commented 8 years ago

I just added some public variables in order to customize the denied and disabled alerts. I'm not an experimented Swift developper so please let me know whether it's fine for you.

Thanks for your review !

nickoneill commented 8 years ago

Thanks @akofman, I can see this being useful.

How are you accessing the pretty permission name used in the default deniedAlertTitle as permission.prettyDescription from your override?

akofman commented 8 years ago

Hello,

Yep, I don't access it from the override value. I actually tested this case from request* methods and in this particular case it doesn't really matter because I can update the title before displaying the alert. But indeed I didn't think about the dialog :/ Do you have any guidance about that ? Would it be better with something like a template string ?

akofman commented 7 years ago

Hello @nickoneill,

I have updated/rebased this PR in order to give access to the permission.prettyDescription from the override title and message.

As an example now you can init the PermissionScope instance as following: pscope.disabledAlertTitle = "Hey ! %@ permission is disabled."

akofman commented 7 years ago

Bump :)