Support for two versions of Today Widget ios 9/10

I would like to know if this is possible, and then how to support two versions of my Today Widget for iOS 9 and iOS 10, which are displayed only in the right OS.

So far, I have tried to have two goals for deployment for iOS 9, and the other for iOS 10. Unfortunately, in the simulator, iOS 10 displays as Today Widget.

Is there a way to do this, or do I need to process it in my code, checking in which version I am included?

+4
source share
1 answer

As long as you cannot prevent the target widget type of iOS 9 from being displayed in the widget selection list, you can install hasContent falseon it and it will not appear in Today by view

[[NCWidgetController widgetController] setHasContent:NO forWidgetWithBundleIdentifier:YourTodayWidgetBundleIdentifier];

, .

+1

Source: https://habr.com/ru/post/1648483/


All Articles