How to clear emoji font cache in iOS application (keyboard extension)

核能气质少年 提交于 2019-12-08 06:51:12

问题


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:

  1. 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);

  2. 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;

来源:https://stackoverflow.com/questions/33892770/how-to-clear-emoji-font-cache-in-ios-application-keyboard-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!