0

My app is iOS 13+ and Mac Catalyst ("scaled").

Minimum deployment is set to iOS 13.6 and macOS 10.15.6.

The iOS 14 version of the app has a widget.

I want to either use this same widget in macOS 11 Big Sur, or create a new one for Mac with identical features.

I tried:

  • Using the same widget: I can't see anything about this in the WidgetKit doc, I failed finding a way, and checking the Mac box in the widget's extension Deployment Info panel compiles but doesn't seem to do anything (I don't see the widget in Big Sur's panel) whatever options I'm choosing.

  • Create a Mac widget extension: doesn't work because the app is not a 'real' Mac app, it's Catalyst. If I add the mac widget extension and do nothing else I can't compile anymore (dozens of UIKit headers errors).

What's the process to make a Big Sur widget from a Mac Catalyst app?

  • The first thing you tried, checking the “Mac” checkbox should work. Then just run the main app and your widgets should appear in the widget picker. Do you have multiple copies of your app installed? E.g., one in Applications and another in Xcode’s build directory? That can cause problems. – Adam Dec 09 '20 at 00:36
  • @Adam Ah! I just found the solution while resetting everything in the Info panel. Turns out the ".appex" file was set on "iOS" in "Platforms", it needed to be on "macOS + iOS". I'm sure it was, at some time in the past. I'm probably wrong. Does not matter, problem solved. Thank you for your feedback, it gave me motivation to try again. :) – Butterfly Ball Dec 13 '20 at 19:55

1 Answers1

2

This was simply a problem of misconfiguration in Xcode.

The most important missing part was that the widget extension file named ".appex" wasn't included in the bundle when compiling for macOS (in the "Frameworks, Libraries, and Embedded Content" section).

Also, the widget mac target was set to 10.15 instead of 11.0, and there where minimum deployment version conflicts and several Swift version errors.

Setting all these parameters right fixed the issue.