1

Situation

My app provides multiple widgets and only some of the widgets use location, thus I separated the widgets into multiple extensions. This allows the system to only prompt the user for the widgets that use location information. I can't use the WidgetBundle approach anymore, to determine the order of the widgets in the widget gallery.

Problem

Is there another way to determine the order of the widgets in the widget gallery with two extensions?

What I have tried:

I created a Swift-file which has a target membership to both app extensions. I used the WidgetBundle approach described here: Can I determine the order of the widgets in the gallery (Swift)?. I declared the class as the only @main for both extensions and expected it to show the order as listed in the class. Xcode threw and error, that my widgets were out of scope despite the target membership being correct.

I tried to reorder the targets in my project, and expected that the widgets' order will be displayed accordingly.

1 Answers1

0

I have raised a TSI and that is the answer I got:

"You should not use 2 separate extensions. Instead you should use 1 extension and a Widget Bundle, which also specifies the order of how they show. I understand your use case but you are slowing your apps compile time and there is no way to provide order for 2 separate extensions as they belong to different processes. [...] I would change the app [to using one widget extension] and file an enhancement request for permissions to be specific to a given Widget.".

So that is what I will do.