Я экспериментировал с фиксированной анимацией для «подделки» подержанных рук. секунды. Но виджет продолжает «зависать», это моя проблема.
Есть какие-нибудь советы или рекомендации, чтобы мой виджет работал и «обновлялся» каждую секунду?
Я видел несколько приложений в App Store, которые делают это. Так что это должно быть возможно.
Код: Выделить всё
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..
Подробнее здесь: [url]https://stackoverflow.com/questions/79349600/analog-clock-widgetkit-keeping-it-updated[/url]