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

Some properties of SPPermissionDialogDataSource don't change anything #106

Closed Xedart closed 5 years ago

Xedart commented 5 years ago

There are some properties and methods in SPPermissionDialogDataSource that don't affect any appearance. They are:

deniedTitle deniedSubtitle cancelTitle settingsTitle

Even though I have overridden them, nothing changed in UI

ivanvorobei commented 5 years ago

All work correctly.

Screenshot 2019-05-06 at 14 09 02
Xedart commented 5 years ago

Hmm, strange... But it doesn't work in my setup Take a look:

Screen Shot 2019-05-06 at 14 41 35

All others customizations work!

ivanvorobei commented 5 years ago

You can create simple project and send here link?

Xedart commented 5 years ago

Sure, here is my sample project:

PermissionSample.zip

Notice how just those 4 customizations don't work whilst all others do

Xedart commented 5 years ago

I figured out this issue, it was my fault, as I passed the SPPermissionDialogDataSource like this:

SPPermission.Dialog.request(
            with: [.camera],
            on: self,
            delegate: nil,
            dataSource: PermissionDialogDataSource()
        )

And of course dataSource is not retained by SPPermission, so it should be created as property and passed like this:


let permissionDataSource = PermissionDialogDataSource()

func presentPermissionDialog() {
        SPPermission.Dialog.request(
            with: [.camera],
            on: self,
            delegate: nil,
            dataSource: permissionDataSource
        )
    }

Now it works fine :)