Search code examples
swiftuiwidgetios14xcode12widgetkit

Xcode 12 iOS 14 Widget without SwiftUI


Is it possible to create Xcode widget in Xcode 12 but without the use of SwiftUI and instead use XIB files to construct the Widget UI?


Solution

  • Widget protocol is only available in SwiftUI framework, so you can only create widgets using SwiftUI.

    https://developer.apple.com/documentation/swiftui/widget

    Update

    You can't use UIKit views wrapped in UIViewRepresentable within SwiftUI for Widgets, It will appear blank.

    https://developer.apple.com/forums/thread/653471