Go further with Complications in WidgetKit

RSS for tag

Discuss the WWDC22 Session Go further with Complications in WidgetKit

Posts under wwdc2022-10051 tag

15 Posts

Post

Replies

Boosts

Views

Activity

Migrating ClockKit complications to WidgetKit not working
I've implemented delegate method suggested in the article https://developer.apple.com/documentation/widgetkit/converting-a-clockkit-app and double (even triple) checked kind and extensionBundleIdentifier of my StaticConfiguration But when I install the app version containing WidgetKit complications they don't replace old ones from ClockKit on the watch face. In the same time old complications are not displayed - I see empty slots. When I check setup in Watch app on the phone I see that old complications remain assigned. If I switch manually to WatchKit based they work fine. It would be helpful if Coffee Tracker code example (referenced in WWDC video and documentation) become updated with migration code.
3
4
3k
Aug ’23
Complications in WidgetKit - .accessoryCorner with curved text
Hello, I am trying out the new Watch Complications in WidgetKit and I am stuck on the widget '.accessoryCorner'. Unfortunately, I can't find a way to create a curved text as shown in the image in the upper left corner ('HON'). Using the '.widgetLabel' does insert a curved label in the second line, but the text above it in the first line remains horizontally arranged. Has anyone found a solution for this yet? Thanks for the help Thomas
9
4
6.1k
Jun ’23
Complications in WidgetKit .accessoryCorner does not support previous functionality ClockKit
For almost a year now, it has been impossible to switch to a new tool, due to the lack of functionality of the old version. I mean the lack of the ability to create a normal angular layout (when there is a view progress, and an inscription is curved above it). Maybe I'm doing something wrong, but I didn't manage to create something similar to a standard complication. Please provide an example of how standard complications of this type were implemented and how to make it use SwiftUI.
0
0
1.3k
Feb ’23
How to bring placeholder or snapshot of widget in Widget Gallery?
How can we add a widget snapshot or placeholder like in the "Widget Galley" list as I have marked in red below? Once I create a widget I can see my app available under the list however not able to make it appear as a snapshot or image. Any help will be appreciated. `private struct ToDoLockScreenWidgetView : View {   var entry: Provider.Entry   @Environment(.widgetFamily) var family       var body: some View {     if #available(iOSApplicationExtension 16.0, *) {       ZStack {         AccessoryWidgetBackground()         Text(entry.toDoWidget?.title ?? "Not available")           .multilineTextAlignment(.center)           .font(.subheadline)           .widgetAccentable()       }       .previewContext(WidgetPreviewContext(family: .accessoryCircular))       .previewDisplayName("(family)")     } else {       Text("")     }   } }
0
0
885
Sep ’22
Can't Load Image on Apple Watch Complications with New iOS 16 Widget
Image("sticker5")             .resizable()             .frame(width: 47, height: 47)             .scaledToFill() sticker5 is a picture with 94px * 94px. This is the size recommended by guideline. The Error is ComplicationsExtension[403:17806] [archiving] Widget archival failed due to image being too large [2] - (94, 94). We don't want to use low pixel images. That would look terrible. Please Help!
3
1
2.1k
Sep ’22
.timer Styled Text does not count up or down in Lock Screen Widgets
Hi, I have an interesting problem about Lock Screen Widget Complications. I prepared a widget which have .timer styled Text to display dynamic dates in my lock screen widget. It works fine in my iOS 16 (with Xcode beta - 6) simulator both debug and release modes. However the timer styled text is not counting up or down in my real device with debug mode, displays static time on screen. Also does not work testflight build of my widget development either. Do you have any idea about this issue?
3
2
1.7k
Sep ’22
WatchOS9 - Widgetkit complications do not appear on simulator
Hi, I followed excactly the steps in https://developer.apple.com/videos/play/wwdc2022/10050 to add Widgetkit for watchOS to my existing iOS Widgets. Both widgets do work for iOS, but on my Apple Watch, my widget is invisible to be set as a complication. Any idea what I'm doing wrong? ... @available(iOSApplicationExtension 16.0, *) struct MyWidget: Widget {  private let kind: String = "MyWidget"     var body: some WidgetConfiguration {   return IntentConfiguration(kind: kind, intent: WidgetConfigurationIntent.self, provider: Provider()) { entry in    MyWidgetComponent(entry: entry)   }   .configurationDisplayName("widget_name_description".localized())   .description("widget_name_description".localized())   .supportedFamilies([.accessoryCircular, .accessoryRectangular, .accessoryInline])  } } @main struct MyAppWidgets: WidgetBundle {  #if os(watchOS)  var body: some Widget {   return MyWidget()  }  #else  var body: some Widget {   if #available(iOS 16.0, *) {    return WidgetBundleBuilder.buildBlock(OtherIosWidget(), MyWidget())   } else {    return OtherIosWidget()   }  }  #endif } ...
2
0
1.9k
Sep ’22
AccessoryCorner widgets with similar layout as the system calendar complication
When the system calendar complication is shown in the corner, it has the title of the upcoming event as the widget label and the time of the event as the main widget view. However the time of the event is not small and clipped to a circle like WidgetKit renders the complication but larger and curved together with the label. Is there a way to achieve the system corner complication layout with the WidgetKit complications?
1
1
1.2k
Sep ’22
WidgetKit accessing location issue
I need to use location in my widget. Here's what I did: Set Widget Wants Location and Privacy - Location When In Use Usage Description in my widget extension Run the widget The problem is that every time I run the widget for the very first time, I tap "Allow" when asked to permit access to my location and then it crashes with this: I'm really confused why this is happening, since I'm not even doing any operation that involves anything from CoreLocation. The second time I run the widget, works great. I can access current location and do whatever I want. At first I thought that because of my implementation of CLLocationManagerDelegate I'm getting this, but then I removed everything related to CoreLocation from my codebase except the configurations I'm talking about above. What am I missing?
1
0
1.2k
Sep ’22
I just want to show [Second] for timer app on watch complication
I could make countdown on watch complication by using [.timer]. However its showing [Hour], [Minute] and [Second], and I just want to show [Second] instead of [Hour] and [Minute]. Lets say if I set the time with [5 minutes] then I would like to make it showing [300] instead of [5:00]. So what will be the best code I should write? Please kindly advise.
0
0
696
Jun ’22
Migrating ClockKit complications to WidgetKit not working
I've implemented delegate method suggested in the article https://developer.apple.com/documentation/widgetkit/converting-a-clockkit-app and double (even triple) checked kind and extensionBundleIdentifier of my StaticConfiguration But when I install the app version containing WidgetKit complications they don't replace old ones from ClockKit on the watch face. In the same time old complications are not displayed - I see empty slots. When I check setup in Watch app on the phone I see that old complications remain assigned. If I switch manually to WatchKit based they work fine. It would be helpful if Coffee Tracker code example (referenced in WWDC video and documentation) become updated with migration code.
Replies
3
Boosts
4
Views
3k
Activity
Aug ’23
Complications in WidgetKit - .accessoryCorner with curved text
Hello, I am trying out the new Watch Complications in WidgetKit and I am stuck on the widget '.accessoryCorner'. Unfortunately, I can't find a way to create a curved text as shown in the image in the upper left corner ('HON'). Using the '.widgetLabel' does insert a curved label in the second line, but the text above it in the first line remains horizontally arranged. Has anyone found a solution for this yet? Thanks for the help Thomas
Replies
9
Boosts
4
Views
6.1k
Activity
Jun ’23
Complications in WidgetKit .accessoryCorner does not support previous functionality ClockKit
For almost a year now, it has been impossible to switch to a new tool, due to the lack of functionality of the old version. I mean the lack of the ability to create a normal angular layout (when there is a view progress, and an inscription is curved above it). Maybe I'm doing something wrong, but I didn't manage to create something similar to a standard complication. Please provide an example of how standard complications of this type were implemented and how to make it use SwiftUI.
Replies
0
Boosts
0
Views
1.3k
Activity
Feb ’23
Animations on IOS16 LockScreen Widget
Hello guys , I'm having trouble with Animations on LockScreen Widget, after reading tons of apple's documents and videos, still did't find the way. Can anyone enlight me for a little bit?
Replies
2
Boosts
0
Views
1.7k
Activity
Oct ’22
How to bring placeholder or snapshot of widget in Widget Gallery?
How can we add a widget snapshot or placeholder like in the "Widget Galley" list as I have marked in red below? Once I create a widget I can see my app available under the list however not able to make it appear as a snapshot or image. Any help will be appreciated. `private struct ToDoLockScreenWidgetView : View {   var entry: Provider.Entry   @Environment(.widgetFamily) var family       var body: some View {     if #available(iOSApplicationExtension 16.0, *) {       ZStack {         AccessoryWidgetBackground()         Text(entry.toDoWidget?.title ?? "Not available")           .multilineTextAlignment(.center)           .font(.subheadline)           .widgetAccentable()       }       .previewContext(WidgetPreviewContext(family: .accessoryCircular))       .previewDisplayName("(family)")     } else {       Text("")     }   } }
Replies
0
Boosts
0
Views
885
Activity
Sep ’22
Can't Load Image on Apple Watch Complications with New iOS 16 Widget
Image("sticker5")             .resizable()             .frame(width: 47, height: 47)             .scaledToFill() sticker5 is a picture with 94px * 94px. This is the size recommended by guideline. The Error is ComplicationsExtension[403:17806] [archiving] Widget archival failed due to image being too large [2] - (94, 94). We don't want to use low pixel images. That would look terrible. Please Help!
Replies
3
Boosts
1
Views
2.1k
Activity
Sep ’22
.timer Styled Text does not count up or down in Lock Screen Widgets
Hi, I have an interesting problem about Lock Screen Widget Complications. I prepared a widget which have .timer styled Text to display dynamic dates in my lock screen widget. It works fine in my iOS 16 (with Xcode beta - 6) simulator both debug and release modes. However the timer styled text is not counting up or down in my real device with debug mode, displays static time on screen. Also does not work testflight build of my widget development either. Do you have any idea about this issue?
Replies
3
Boosts
2
Views
1.7k
Activity
Sep ’22
WatchOS9 - Widgetkit complications do not appear on simulator
Hi, I followed excactly the steps in https://developer.apple.com/videos/play/wwdc2022/10050 to add Widgetkit for watchOS to my existing iOS Widgets. Both widgets do work for iOS, but on my Apple Watch, my widget is invisible to be set as a complication. Any idea what I'm doing wrong? ... @available(iOSApplicationExtension 16.0, *) struct MyWidget: Widget {  private let kind: String = "MyWidget"     var body: some WidgetConfiguration {   return IntentConfiguration(kind: kind, intent: WidgetConfigurationIntent.self, provider: Provider()) { entry in    MyWidgetComponent(entry: entry)   }   .configurationDisplayName("widget_name_description".localized())   .description("widget_name_description".localized())   .supportedFamilies([.accessoryCircular, .accessoryRectangular, .accessoryInline])  } } @main struct MyAppWidgets: WidgetBundle {  #if os(watchOS)  var body: some Widget {   return MyWidget()  }  #else  var body: some Widget {   if #available(iOS 16.0, *) {    return WidgetBundleBuilder.buildBlock(OtherIosWidget(), MyWidget())   } else {    return OtherIosWidget()   }  }  #endif } ...
Replies
2
Boosts
0
Views
1.9k
Activity
Sep ’22
AccessoryCorner widgets with similar layout as the system calendar complication
When the system calendar complication is shown in the corner, it has the title of the upcoming event as the widget label and the time of the event as the main widget view. However the time of the event is not small and clipped to a circle like WidgetKit renders the complication but larger and curved together with the label. Is there a way to achieve the system corner complication layout with the WidgetKit complications?
Replies
1
Boosts
1
Views
1.2k
Activity
Sep ’22
WidgetKit accessing location issue
I need to use location in my widget. Here's what I did: Set Widget Wants Location and Privacy - Location When In Use Usage Description in my widget extension Run the widget The problem is that every time I run the widget for the very first time, I tap "Allow" when asked to permit access to my location and then it crashes with this: I'm really confused why this is happening, since I'm not even doing any operation that involves anything from CoreLocation. The second time I run the widget, works great. I can access current location and do whatever I want. At first I thought that because of my implementation of CLLocationManagerDelegate I'm getting this, but then I removed everything related to CoreLocation from my codebase except the configurations I'm talking about above. What am I missing?
Replies
1
Boosts
0
Views
1.2k
Activity
Sep ’22
iOS 16 Lock Screen Widgets - Open app with params
Hi, is it possible to do not just open the widget's app, but pass some additional params like it's working in "old" widgets via public func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) 🤔
Replies
2
Boosts
0
Views
2.2k
Activity
Aug ’22
iOS 16 beta 2 widget
There is a reference to the official website to create a custom lock screen widget, but the results cannot be searched and displayed. How can it be displayed normally?
Replies
5
Boosts
0
Views
1k
Activity
Aug ’22
Can WidgetURL be used with LockScreen Widget?
Can WidgetURL be used with LockScreen Widget? I want to tap LockScreen Widget to switch to a specific screen.
Replies
1
Boosts
0
Views
1.5k
Activity
Jul ’22
I just want to show [Second] for timer app on watch complication
I could make countdown on watch complication by using [.timer]. However its showing [Hour], [Minute] and [Second], and I just want to show [Second] instead of [Hour] and [Minute]. Lets say if I set the time with [5 minutes] then I would like to make it showing [300] instead of [5:00]. So what will be the best code I should write? Please kindly advise.
Replies
0
Boosts
0
Views
696
Activity
Jun ’22
Widget Kit
How to establish communication with multiple parameters in single intent with a parent-child relationship? Where the output of the parent parameter will be input for the child parameter.
Replies
1
Boosts
0
Views
826
Activity
Jun ’22