Use for WidgetKit introduced in iOS 14 and macOS Catalyst 14
Questions tagged [widgetkit]
520 questions
16
votes
4 answers
Xcode iOS 14 WidgetKit not always attached to debugger
I'm developing WidgetKit extension on iOS 14,
however, the extension doesn't always connect to Xcode debugger after build and run, causing I can't see logs, as this image shows: (But sometimes it'll automatically attach, I don't know why)
If the…

Johnny
- 2,589
- 2
- 27
- 34
13
votes
3 answers
iOS 14 widgets are displayed black on live app
I am working on application in which i am using widgetkit extension. i have got one wierd issue like widget is displaying properly on development side, but when i make application live it displays the blank (black) widget to the user.
Screenshot…

Tejas Patel
- 850
- 10
- 26
13
votes
5 answers
iOS 14 Widget Not Refreshing
Update: I have tried setting the policy on the timeline to .atEnd, since there is only one entry. This has not made a difference. I have tried both in the RSS Parser file, and in the AppDelegate to run the WidgetCenter reloadAllTimeLines method, and…

user717452
- 33
- 14
- 73
- 149
12
votes
3 answers
Updating time text label each minute in WidgetKit
Is it possible to create text label in Widget that will show current time and will be updating in real-time?
Trying to create clock widget, but widget is updating only 1 time each 5 minutes.
Creation of timeline not helped
"Keeping a Widget Up To…

Maks
- 302
- 1
- 2
- 10
12
votes
2 answers
How to download images async for WidgetKit
I am developing Widgets for iOS and I really don't know how to download images for the widgets.
The widget currently downloads an array of Objects, and every object has a URL of an image. The idea is that every object makes a SimpleEntry for the…

Joan Cardona
- 3,463
- 2
- 25
- 43
12
votes
2 answers
Need help to make iOS 14 Widget show content from from REST api
The original question is at Apple forum but no one can help.
https://developer.apple.com/forums/thread/654967?answerId=622833022#622833022
I decided to ask on SO.
Problem
I'm developing a widget extension that show content from REST api.
It show the…

Neo.Mxn0
- 953
- 2
- 8
- 25
11
votes
1 answer
Widget preview is using wrong size family
I have a widget view looking like this:
struct WidgetEntryView: View {
var entry: Provider.Entry
@Environment(\.widgetFamily) var family
var body: some View {
switch family {
case .systemSmall:
ZStack {
…

Adam Bardon
- 3,829
- 7
- 38
- 73
11
votes
2 answers
iOS 14 widget works locally, but fails via TestFlight
I have a SwiftUI app with a widget. When I run the app via Xcode (either straight to my device or on the simulator), the widget works exactly as expected.
However, when I run the app through TestFlight, the widget does appear, but it does not show…

West1
- 1,430
- 16
- 27
10
votes
1 answer
Always receiving .systemMedium when requesting Environment widget family
I'm trying to get the right widget family in a view, but I'm always getting .systemMedium value. This is my view:
import SwiftUI
struct MyView: View
{
@Environment(\.widgetFamily) var family
let entry: MyEntry
@ViewBuilder
var…

iOS Dev
- 4,143
- 5
- 30
- 58
10
votes
1 answer
Animation in iOS 14 widget
I can't find solution to implement kind of ProgressBar in Widget. I see, that Text component should be changed if has type .timer for example. I see default widget Clock, with nice animation of moving arrow. But am I able to implement custom…

Konstantin.Efimenko
- 1,242
- 1
- 14
- 38
10
votes
0 answers
How do you manage iOS widget background requests?
I'm trying to understand Apple's documentation for Widget background network requests.
To handle the result of the network request, use the onBackgroundURLSessionEvents(matching:_:) modifier to your widget’s configuration, and do the…

Gil Birman
- 35,242
- 14
- 75
- 119
10
votes
3 answers
Can I add WidgetKit extensions to an app with target iOS < 14?
I want to add a (WidgetKit-)widget to my iOS app. The app itself should keep a target of < 14. Obviously, the widget would be available only on those devices >= 14, but the app should run on all other devices as well. Is this possible?

Kai Huppmann
- 10,705
- 6
- 47
- 78
10
votes
3 answers
iOS 14 Widgets + SwiftUI + Firebase?
I'm still pretty new to SwiftUI and Firebase. Recently, as a hobby, I have been developing an app for my school. After the launch of Xcode 12, I decided to experiment with the new features such as Widgets. However, since my app gets its data from…

Daniel Ho
- 131
- 1
- 7
9
votes
2 answers
iOS 14 Widget auto-refresh every day
I have played around with the new iOS 14 widgets, and seems to be working almost fine, except the auto-refresh. My goal is to have my widget refreshed every midnight (so, only once per day, and of course occasionally if something happens in my app).…

zdtorok
- 594
- 1
- 7
- 21
9
votes
2 answers
Fetching current location in iOS 14 Widget
Has anyone tried to update user's location in iOS 14 Widget?
After reading Apple Developer forums I've come up with the writing wrapper around CLLocationManager and using it this way:
class WidgetLocationManager: NSObject, CLLocationManagerDelegate…

Nikita Zernov
- 5,465
- 6
- 39
- 70