Use for WidgetKit introduced in iOS 14 and macOS Catalyst 14
Questions tagged [widgetkit]
520 questions
4
votes
2 answers
iOS14 Intents on small widget only
I have a widget with Intents configured for my iOS 14 app. For the small widget, the intent is necessary because I can only fit half of the information that I could display so I give the user what half to display through the intent selection. For…

Stewart Lynch
- 875
- 9
- 26
4
votes
1 answer
How to debug Widget Xcode 12
How to debug Widgets (WidgetKit) on Xcode 12?
For example, setting breakpoints or at least making print statements work.
Thank you!

Tung Fam
- 7,899
- 4
- 56
- 63
4
votes
1 answer
How to customize placeholder looks in SwiftUI WidgetKit placeholder?
With the way my code is set up, when my Widget is being displayed as a placeholder right before actual data comes in, it looks ugly because of the image placeholder being cut off by the Circle() clip path.
Here's the SwiftUI code (the first Image…

Miles
- 487
- 3
- 12
4
votes
1 answer
Updating iOS 14 Home Widget from StaticConfiguration to IntentConfiguration
Has anyone successfully migrated their iOS 14 Home Widget from using StaticConfiguration to IntentConfiguration?
My widgets are completely broken, stuck in placeholder state, after migration. The only solution is to remove and re-add them. This…

damirstuhec
- 6,069
- 1
- 22
- 39
4
votes
1 answer
Sharing Data with AppGroup
I want to share one variable from my UIKit File to my Widget Extension created with SwiftUI.
I followed this here. Please look at the answer from J Arango.
But i dont understand the last part there.
I have to use import MySharedObjects.
So I did…

submariner
- 308
- 1
- 5
- 23
4
votes
0 answers
How to return a dynamic list of widgets in SwiftUI WidgetBundleBuilder body
Is it possible to create a dynamic list of widgets inside the body of WidgetBundle? For example:
@main
struct HomeWidgetBundle: WidgetBundle {
@WidgetBundleBuilder
var body: some Widget {
List {
…

J.Doe
- 326
- 2
- 14
4
votes
1 answer
How to call WidgetCenter.shared.reloadAllTimelines() when Core Data in CloudKit changes?
I have an app that uses Core Data with CloudKit. Changes are synced between devices. Main target has Background Modes capability with checked Remote notifications, iCloud capability is checked with Services set to CloudKit and correct container in…

Igor R.
- 399
- 4
- 23
4
votes
3 answers
I have added Widgetkit to my app but now crash on iOS 13 when the app starts on Xcode 12 beta
I have added WidgetKit to my app but on iOS 13 devices it crashes when the app starts with this error:
dyld`__abort_with_payload
The part of the code that causes the crash is this:
static func reloadTimelines () {
if #available(iOS 14, *)…

Tomeu Mascó
- 319
- 2
- 11
4
votes
0 answers
How to properly setup widget for background update on macos?
I'm building a widget for macOS, which is target for macOS only. And, it keeps crashing after an attempt to recreate another timeline (from getTimeline function)
It throws the following error:
Terminating app due to uncaught exception…

Amadeu Cavalcante Filho
- 2,140
- 18
- 29
4
votes
4 answers
Fail to preview Widget in Xcode with SwiftUI Preview
I am trying to preview some View by using Widget context, like:
struct MyTasksView_Previews: PreviewProvider {
static var previews: some View {
MyTasksView(
myTasks: Fake.myTasks,
user: Fake.user,
…

Amadeu Cavalcante Filho
- 2,140
- 18
- 29
3
votes
0 answers
WidgetKit complications won't update
We are migrating ClockKit complications to WidgetKit in our watch app (watchOS 9+).
The migration went smoothly, UI part works just fine. However, we've hit the wall with widgets not updating when requested by the watch app.
I believe we are missing…

Serzhas
- 854
- 12
- 23
3
votes
1 answer
WidgetKit not showing any debugger logs in Xcode 14
I am having a problem with WidgetKit in Xcode 14 which is the debugger doesn't show any logs at all! even a simple print(). I have tried different ways
Running on the real device
Clean DerivedData folder
Attaching to process using Debug -> Attach…

Mc.Lover
- 4,813
- 9
- 46
- 80
3
votes
0 answers
iOS SwiftUI WidgetKit: My widgets don’t show up in the ‘Add Widgets’ section
I developed an app with 10 widgets but some iPhone, iPad or macOS users report that my widgets or the "App Name" don't appear in the widgets list when they tried to add the widgets of my app.
There's no way I can replicate the problem, but the…

Meroelyth
- 5,310
- 9
- 42
- 52
3
votes
1 answer
How to implement the same iOS 16 lock screen circular widget myself?
I'm trying to implement lock screen widget myself
Widget I currently implement
I want to implement this ios16 lock screen widget
I've made almost everything, but I haven't been able to implement the small circle's transparent border.
I couldn't…

msgu
- 45
- 5
3
votes
1 answer
How to animate WidgetKit Widgets like other apps do it?
While Apple stated that animations should not be possible in Widgets, some apps managed to implement them. Example: https://apps.apple.com/app/id1588400483
These don’t only animate every second statically, but seemingly with 60/120 fps. How to…

Jann Thomas
- 122
- 6