sunshinejr / SwiftyUserDefaults

Modern Swift API for NSUserDefaults
http://radex.io/swift/nsuserdefaults/static
MIT License
4.84k stars 364 forks source link

Conflicting with `empty` cases #274

Closed Igor-Palaguta closed 3 years ago

Igor-Palaguta commented 3 years ago

Love this library so much, but found that after adding it empty from OptionalType shadows application's empty cases from enums, e.g.:

Screenshot 2021-02-16 at 14 03 59

So, unfortunately had to remove it

ky1vstar commented 3 years ago

You can try if case .empty = enumValue {

sunshinejr commented 3 years ago

Hey @Igor-Palaguta, sorry for the issue. I'd love to get this fixed asap. Ideally by not exposing that to the user, but for now a simple rename from .empty to e.g. __swiftyUserDefaultsIsEmpty would be enough - would you or @ky1vstar be up for a PR?

Igor-Palaguta commented 3 years ago

Hello @sunshinejr , yes sure let me prepare PR

Thanks

sunshinejr commented 3 years ago

@Igor-Palaguta FYI I just merged #279 and released 5.3.0 to CocoaPods with a rename. Will think about a better solution that ideally will remove the public protocol, but to quickly fix it for your use-case I think it's enough. Let me know if it helped!

Igor-Palaguta commented 3 years ago

Thank you @sunshinejr