I'm trying to add a widget to my SwiftUI Application. I've made a Widget Extension in my App. Upon running the target in the simulator, this error appears in the console:
ClipperWidgetExtension[7343:594354] Fatal error: PlatformViewRepresentableAdaptor<ListRepresentable<SystemListDataSource<Never>, SelectionManagerBox<Never>>>: file /Library/Caches/com.apple.xbs/Sources/Chrono_Sim/Chrono-63.5/WidgetKit/SPI/WidgetViewArchive.swift, line 254
The line that Xcode brings my attention to is this:
completion(Timeline(entries: [SimpleEntry()], policy: .never))
The whole code for my timeline provider and entry:
struct Provider: TimelineProvider {
public typealias Entry = SimpleEntry
public func snapshot(with context: Context, completion: @escaping (SimpleEntry) -> ()) {
let entry = SimpleEntry()
completion(entry)
}
public func timeline(with context: Context, completion: @escaping (Timeline<Entry>) -> ()) {
completion(Timeline(entries: [SimpleEntry()], policy: .never))
}
}
struct SimpleEntry: TimelineEntry {
var date: Date = Date()
}
Any help would be appreciated :)
2
1
2.1k