I have an existing app and i want to release a version to support IOS10 devices. The problem is that my app today widget not is supporting the new today view in IOS10 and i want to disable the today widget to all IOS10 users. It it possible? I already tried to set to today widget to Base SDK of 9.3 from XCode build settings and it didn't work Thanks!
Asked
Active
Viewed 709 times
1 Answers
4
You can show/hide the widget from within you Containing App based on your requirement.
if #available(iOSApplicationExtension 10.0, *)
{
DispatchQueue.main.async(execute: {
NCWidgetController.widgetController().setHasContent(false, forWidgetWithBundleIdentifier: "YourWidgetBundleIdentifier")
})
}

PGDev
- 23,751
- 6
- 34
- 88
-
I am getting an error for 'Use of unresolved identifier 'NCWidgetController' in Containing App. Please help. – kushalrshah Jun 03 '19 at 11:23
-
Which `iOS version` are you using? – PGDev Jun 03 '19 at 12:07
-
Add `import NotificationCenter` to the top of your file. – PGDev Jun 03 '19 at 12:10
-
this does work however the widget is still available and can still be added to the Today View. It just does not show anything. – hotdogsoup.nl Oct 10 '20 at 07:53