WidgetKit with UIKit

I would like to build a WidgetKit widget using UIKit, but I know you can only make them in SwiftUI. Are there any workarounds?

Could we try to make a storyboard and then add it to the widget like this?

Answered by Systems Engineer in 625145022
WidgetKit widgets can only be build with SwiftUI, the SoTU from WWDC2020 and Intro to WidgetKit videos both dive into why.
WidgetKit widgets can only be build with SwiftUI, the SoTU from WWDC2020 and Intro to WidgetKit videos both dive into why.
Is it possible to only pass a variable from UIkit to SwiftUI?
Is it possible to use UIReprsentableView
UIViewRepresentable should work as it can be embedded in SwiftUI Views.

Our official recommendation is to use SwiftUI views exclusively to take advantage of the framework's offerings. Some apps may use things like a web view or other type of view shoehorned into their Widget which can lead to battery / power implications which can lead to less frequent updates and or crashes, hangs and more. If possible, please share more details on why you think you need a UIKit view in your Widget (if this post is relevant today).

Rico
WWDR - DTS - Software Engineer

WidgetKit with UIKit
 
 
Q