parse-community / Parse-SDK-iOS-OSX

The Apple SDK for Parse Platform (iOS, macOS, watchOS, tvOS)
https://parseplatform.org
Other
2.81k stars 871 forks source link

Add NSSecureCoding to PFFileObject #1736

Open dhoerl opened 1 year ago

dhoerl commented 1 year ago

New Feature / Enhancement Checklist

Current Limitation

PFFileObject does not implement NSSecureCoding.

Feature / Enhancement Description

Directly add NSSecureCoding to PFFileObject. The code to do this is less than 50 lines of code. Essentially, you have PFEncoder encode the file object first, then the NSSecureCoder just encodes the dictionary returned by PFEncoder. Creating an instance is just the inverse.

Since I have the code, I could create a Pull Request with it, if there is an understanding that it would be merged at some point.

Example Use Case

I create a PFFileObject in an app, in some class. I want to then serialize that object using NSSecureCoding. I can do this with a class extension in Objective-C, but now that the app is being converted to Swift, I will need to keep the Objective-C code around forever.

Alternatives / Workarounds

Use a class extension in Objective-C

3rd Party References

NSSecureCoding is widely used.

parse-github-assistant[bot] commented 1 year ago

Thanks for opening this issue!

mtrezza commented 1 year ago

Sure, please feel free to open a PR, we will be happy to review.