Hi everyone,
I have added WidgetKit to my app but on iOS 13 devices it crashes when the app starts with this error:
The part of the code that causes the crash is this:
I have tried other unsuccessful variations like this:
The project is in objective-c and I import that class in swift.
But without adding #import "myApp-Swift-h" anywhere, or using that class it keeps crashing.
Can someone tell me what I am doing wrong or what is happening?
Thanks in advance.
I have added WidgetKit to my app but on iOS 13 devices it crashes when the app starts with this error:
Code Block dyld`__abort_with_payload
The part of the code that causes the crash is this:
Code Block static func reloadTimelines () { if #available(iOS 14, *) { WidgetCenter.shared.reloadTimelines(ofKind: "com.myDomain.myApp.ProgressWidget") } }
I have tried other unsuccessful variations like this:
Code Block @available(iOS 14, *) static func reloadTimelines () { WidgetCenter.shared.reloadTimelines(ofKind: "com.myDomain.myApp.ProgressWidget") }
The project is in objective-c and I import that class in swift.
But without adding #import "myApp-Swift-h" anywhere, or using that class it keeps crashing.
Can someone tell me what I am doing wrong or what is happening?
Thanks in advance.
I have an app with WidgetKit running on iOS13 using xcode beta6. I was getting a crash as well, to fix it I added the WidgetKit.framework binary to my app target and marked it "optional" and now the app loads.
To make sure iOS13 code doesn't try to call WidgetCenter I just wrap the calls in:
if #available(iOS 14, *) {
WidgetCenter.shared.reloadAllTimelines()
}
To make sure iOS13 code doesn't try to call WidgetCenter I just wrap the calls in:
if #available(iOS 14, *) {
WidgetCenter.shared.reloadAllTimelines()
}