Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 12 iOS 14 Widget without SwiftUI

Tags:

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?

like image 481
Vlad Avatar asked Jun 23 '20 06:06

Vlad


People also ask

Is SwiftUI same as Xcode?

SwiftUI is more than a framework. It is integrated into Xcode, enabling developers to build user interfaces much faster than ever before. You can edit the user interface of your application in code or in a visual editor that automatically reflects what your code translates to.

How do you turn an app into a widget on iPhone?

Go to the Home Screen page where you want to add the widget, then touch and hold the Home Screen background until the apps begin to jiggle. at the top of the screen to open the widget gallery. Scroll or search to find the widget you want, tap it, then swipe left and right through the size options.


1 Answers

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

like image 179
Bilal Avatar answered Oct 26 '22 10:10

Bilal