We've implemented the WidgetKit extension, so since on iOS 14 it seems like Today Extensions are placed all the way at the bottom of the Today View, we would like to simply remove Today Extension on iOS 14 and keep it only for iOS 13 users, but I haven't found a way to do this yet.
Commenting the code doesn't do much. I suspect because the appex is still there.
There doesn't seem to be a way with availability API to specify a maximum iOS version at a file level, only inside methods (else branch).
I've tried setting NCWidgetController().setHasContent(false, forWidgetWithBundleIdentifier: "...") in both the main app and the Today Extension view did load.
The only thing that any of these solutions every did was make the Today Extension appears as Unable to Load, but not actually disappearing.
Is there something I'm missing?
The today extension is either in your bundle or it isn't. You can't include it conditionally based on the execution device since you don't know what version of iOS your app will execute on at compile time.
You can raise your minimum supported iOS version to 14 and remove the today extension or keep compatibility with earlier versions and keep it in.