iosobjective-cquickaction

Set iOS dynamic quick action icon from url


I'm working but on iOS dynamic quick actions, and I want to use image from url, to be set as the quick action icon.

Is it possible? I didn't find an answer for that..


Solution

  • Unfortunately, it's not possible using public API.

    UIApplicationShortcutIcon only allows creating icons from contacts, images found in the bundle or predefined system icons.

    If you are willing to use private API (you shouldn't), there exist two methods which allow this:

    + (id)iconWithCustomImage:(id)arg1 isTemplate:(_Bool)arg2;
    + (id)iconWithCustomImage:(id)arg1;
    

    It still wouldn't be a URL. You'd need to create a UIImage instance and call these methods with that image.