Ich habe mit einer festen Animation für die „Fälschung“ aus zweiter Hand experimentiert. die Sekunden. Aber das Widget bleibt ständig „hängen“, das ist mein Problem.
Gibt es irgendwelche Tipps oder Tricks, damit mein Widget jede Sekunde läuft und „aktualisiert“ bleibt?
Ich habe mehrere Apps im App Store gesehen, die dies tun. Es muss also möglich sein.
Code: Select all
struct Provider: AppIntentTimelineProvider {
func placeholder(in context: Context) -> SimpleEntry {
SimpleEntry(date: Date(), configuration: ConfigurationAppIntent())
}
func snapshot(for configuration: ConfigurationAppIntent, in context: Context) async -> SimpleEntry {
SimpleEntry(date: Date(), configuration: configuration)
}
func timeline(for configuration: ConfigurationAppIntent, in context: Context) async -> Timeline {
let currentDate = Date()
var entries: [SimpleEntry] = []
// Create entries for the next 30 minutes, one every second
let numberOfEntries = 30 * 60 // 30 minutes * 60 seconds
for offset in 0..