Is it possible to create a widget in iOS 14+ without using SwiftUI? When adding the target it doesn't give you the option between storyboard and SwiftUI like it does when creating a new project. Is it possible to build out a Widget using Storyboard or XIB?
Asked
Active
Viewed 824 times
2
-
You can only use SwiftUI for building widgets. This post lists the types of views that you can use when building a widget https://stackoverflow.com/questions/63135404/why-do-some-views-appear-as-a-red-no-entry-sign-in-widgets – Andrew Jun 14 '21 at 19:09
2 Answers
3
No, it's not possible to create a widget without using SwiftUI. Here's what Apple's documentation says:
To implement a widget, you add a widget extension to your app. You configure the widget with a timeline provider, and use SwiftUI views to display the widget’s content. The timeline provider tells WidgetKit when to update your widget’s content.
AdamPro13
- 7,232
- 2
- 30
- 28
0
If you just want to create a widget without an app, you could use Scriptable, where you write your code in JavaScript and can use native components for your UI.
MultiMedia
- 13
- 5
-
-
Is this a valid technical solution, or a generic approach? WidgetKit has some specific requirements. – benc Jul 01 '23 at 05:41