Adopt Codable for Emoji & Emoji Category
Edited the library to use the default implementations for Codable
The intent is once Emoji is marked as Codable, the structure is now storable using JSON encoding/decoding with ease.
- Edited CodingKeys to have the custom strings used for "skin_tones" & "ios_version" without breaking the Emoji struct's naming pattern
- Edited supportsSkinTones to be Optional Bool, as the key is missing on some Emoji's when loaded from the bundle.
- Edited Picker function getAllEmoji's to return an empty array instead of crashing from a try!
Of note, there are other strategies to remove the exposure of skin_tones being optional, but I am unsure of the preferences here.
This can easily be modified to have a custom decoder/encoder again to mask off this optional Bool if necessary.
Thank you, Robert, very cool.
I'll take a deeper look soon, but on first glance looks good.
Thank you, Robert, very cool.
I'll take a deeper look soon, but on first glance looks good.
I've made a fork and have been testing these changes in an app I am building, so can confirm they are stable & haven't caused issues (yet 😄 )