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 customize icons? #63

Closed emaddoma closed 5 years ago

emaddoma commented 5 years ago

Just updated to 2.1.1 and icon customization is missing

ivanvorobei commented 5 years ago

Good day!

Yes, customization icon disable In the future I plan to add this functionality

emaddoma commented 5 years ago

That's a shame. The previous version was great.

ivanvorobei commented 5 years ago

Dear friend, I find it strange to read. This project is absolutely free, but I get such criticism from you. Do not you think that I myself have to decide what to do? Learning that this is entirely my job.

I also want to note that you can safely use the old version, it is available. Successes

emaddoma commented 5 years ago

No criticism, friend. It's just a little unusual to upgrade to a version with less features. Keep up the good work!

ivanvorobei commented 5 years ago

I am uploading a new version where you can specify your icon

ivanvorobei commented 5 years ago

@emaddoma, I am publish new version 2.1.2, now you can customise icon. See SPPermissionDialogDataSource and override function:

func image(for permission: SPPermissionType) -> UIImage?

Return nil for default value

Thanks for your feedback

furiosFast commented 5 years ago

What should be the size of the icons?

ivanvorobei commented 5 years ago

icons draw by code. Not png or pdf file

furiosFast commented 5 years ago

I mean when using classic PNGs, through the function:

func image(for permission: SPPermissionType) -> UIImage? {
        switch permission {
            case .locationAlways, .locationWhenInUse, .locationWithBackground: return UIImage(named: "xxx")
            case .notification: return UIImage(named: "yyy")
            case .photoLibrary: return UIImage(named: "zzz")
        default: return nil
        }
    }
ivanvorobei commented 5 years ago

For png use min 200px