Sometimes widget UI does not refresh immediately even if you call reloadAllTimelines and takes 2-3 minutes to reflect that change in UI in gallery and home screen, is it known bug or anything i'm missing which i'm not sure of atm
Search results for
[tags:wwdc20-10170]
42 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi there, If the Widget we are developing uses activity data from the Apple Watch via HealthKit, e.g. Active Energy, how can our App read up to date data from Healthkit when it is in the background. And if so how often does the widget refresh. As an experiment I’ve been looking at the Apple Activity widget provided in the ios14 beta, but it out of sync with the Apple Watch activity data over more than a 15 minute duration. I.e the widget had not updated for at least 15 minutes even though the Apple Watch Activity data is constantly updating. many thanks Tim
Classically, the demo in the Meet WidgetKit video used a Calendar as an example, where clearly the times to update are simple to calculate based on when the users events will occur. I'd like to know about the Activity/Fitness Widget. There's no way to tell when a user will burn that next calorie and as far as I can tell, there's still no background observer in HealthKit you can use to call an update on changes. So, with that in mind, how often should I call to update? This same dilemma applies to ClockKit and WatchOS complications.
Hello, is it possible to configure our widgets with a background like the inbuilt system battery widget? It looks like it's using a UIVisualEffectView as it's background which looks fantastic against the user's background. Especially as it transitions for dark mode. I've been through all the docs and designing for WidgetKit but can't figure out how to have anything but a fully opaque background. Setting the background to transparent on my SwiftUI view results in white showing as the background. Thanks, Greg
Hi, I'm trying to Display a MapView like the sytem Maps app does in a Widget. I thought the best way would be to encapsulate the Mapview in a UIViewRepresentable like this: struct MapView: UIViewRepresentable { func makeUIView(context: UIViewRepresentableContext<MapView>) -> MKMapView { let mapView = MKMapView() return mapView } func updateUIView(_ view: MKMapView, context: UIViewRepresentableContext<MapView>) { } } And show it like this in my Widget: struct MapWidgetEntryView : View { var entry: Provider.Entry var body: some View { VStack { MapView() } } } Unfortunately this leads to this error: RemoteHumanReadableError: The operation couldn’t be completed. (BSServiceConnectionErrorDomain error 3.) BSServiceConnectionErrorDomain (3): ==BSErrorCodeDescription: OperationFailed I also tested this with other UIKit classes and it leads to the same error
WidgetKit looks great, I love that it's SwiftUI and lightweight. I'm just trying to see if I understood everything correctly by using an example: Widgets are not mini apps, but really freeze-dried SwiftUI view hierarchies that are then thawed out by the system as needed. That being the case, a developer could not build a countdown or timer widget that would show a label with the current, accurate-to-the-second value of the countdown or timer, correct? While I could imagine that to be a real-world use-case, I do understand that the home screen should not have a lot of things animating and moving, but to be calm.
Hi, I'll try to implement new widgets in my project. My app is based on objc and swift. I want to use new Link of SwiftUI 2 to receive different URLs from the widget to the AppDelegate of my app. According with the min 12:40 of this video, I want multiple links in medium and large size of my widget: developer.apple.com/videos/play/wwdc2020/10028 Like the project Emoji ranger from session Widgets Code-Along. This is an example of my code: HStack { Link(destination: URL(string: urlschemes://link1)!, label: { Image(landscape) }) Link(destination: URL(string: urlschemes://link2)!, label: { Image(portrait) }) } Where urlschemes is the same of URL Schemes in URL types of my app target info. So I want to receive the selected link on the App Delegate, where I used this method: (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options{ tt ttNSLog(@RECEIVED URL: %@,url); } Thanks in advance Fulvio
Hello, I'm experimenting with the WidgetKit template and noticed that adding Images seems to generate a memory leak that terminates my app after surpassing the 30Mb limit. Any idea on how to make images work on widgets?
Hi, We have shipping status widget where user can track package once he logged in the app, the problem now is for the first time it calls getSnapshot method show correct information BUT suppose if user logged out in main app and try to add widget during that time getSnapshot won't get called instead it shows previous cached data, any idea how to make getSnapshot called always when user in gallery?
Topic:
App & System Services
SubTopic:
General
Tags:
wwdc20-10028
wwdc20-10103
wwdc20-10036
WidgetKit
Hi, is there a limitation in WidgetKit that prevent Async Remote Image not working? have been trying a numerous library such as this one https://github.com/dmytro-anokhin/url-image but none of them seems to work. Local image works perfectly tho
Im interested in adding a Widget into my Mix Obj C / Swift project and i believe i can, i understand WidgetKit is SwiftUI but as its an extension i can add it to my ObjC project. My question is (similar to WCSession), is WidgetCenter the framework used in the Main App, to Reload the widget etc. And if so how would you go about doing that in an ObjC project, or how do you reload widget for your main ObjC/Swfit App? Thanks!
Is there a way to find the current widget kind from a view or static function? The use case is: We have a standard text view that is used across two different widgets. However the strings displayed will be different in each widget. How can I find out which widget is using the view at runtime? Thanks!
Is it possible to determine if the device has Touch/Face ID from the home widget? And was it enabled. authError.code equals to kLAErrorBiometryNotAvailable when this code runs from the home widget on the real device. Nevertheless, it works correctly in the Simulator. var authError: NSError? LAContext().canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &authError) It is a bug or a feature?
Hi. I have a widget designed which basically has to authenticate the user. As a result, during the creation of widget, I am passing empty entries to the widget and passing a reload polity of never. This scenario now just shows redacted views. I have seen the WWDC video Meet WidgetKit explaining that widget can awaken from the main app when. Guessing this to be providing timelines entries from main app, how do I do this? There is no documentation explaining the scenario of communication between main app and widgets and neither are there any videos relating to this. Also the video hints at scheduling updates at a certain time from extension, does this mean initial Widget extension or Intents Extension? Any info on these queries would be very helpful as developers would love to have their app driving the widget and not the other way around.
I have this block of code in my project and whenever I build to a < iOS 14.0 it crashes causing the error below if #available(iOS 14.0, *) { if shouldAlertWidgetCenter { WidgetCenter.shared.reloadAllTimelines() } } If I comment out the one line WidgetCenter.shared.reloadAllTimelines() Then it runs fine even though it is in the #available check and shouldn't make any difference. I tried putting the import inside of the canImport block and still crashes unless that line is commented out #if canImport(WidgetKit) import WidgetKit #endif I'm drawing a blank at what I'm doing wrong. Thanks a lot if anyone has any ideas Crash Log: dyld: Library not loaded: /System/Library/Frameworks/WidgetKit.framework/WidgetKit Referenced from: /private/var/containers/Bundle/Application/60E4FB21-B28D-4E44-8972-0370BEB6DAE8/_.app/__ Reason: image not found dyld: launch, loading dependent libraries DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/li