Keyboard extension in iOS is memory limited, when the memory cost is above 50+M, keyboard process will be killed. However, when I am developing the emoji panel in keyboard extension, the emoji panel has to render 800+ emoji icons. From this How to clear font cache filled with emoji characters? I know that, keyboad has to spend 10M memory for emoji rendering for the hundreds emoji icons.
So I have two questions here:
how the iOS system draw the emoji icons, why they have to be converted to png files and those memory is added to keyboard process, not the system(because I think it is a better implement for iOS system to use system resource to render the emoji keys);
Is there a method for me to release the emoji font cache?
I mean, if I could release the emoji font/png cache when user leave the emoji panel, it will be better for the stability of the keyboard extension applications. I think the picture-cutting solution is not really good, because it will make the size of application package bigger(5M+) and I am not sure if there are some potential IP legal problems if the application use Apple's emoji style;