[Widgets]: Use AppIntentConfiguration instead of StaticConfiguration and cleanup

This commit is contained in:
Magesh K
2025-01-10 08:11:35 +05:30
parent 4e10527f03
commit f69b293004
9 changed files with 340 additions and 178 deletions

View File

@@ -0,0 +1,36 @@
//
// ActiveAppsTimelineProvider+Simulator.swift
// AltStore
//
// Created by Magesh K on 10/01/25.
// Copyright © 2025 SideStore. All rights reserved.
//
/// Simulator data generator
#if DEBUG
@available(iOS 17, *)
extension ActiveAppsTimelineProvider {
func getSimulatedData(apps: [AppSnapshot]) -> [AppSnapshot]{
var apps = apps
var newSets: [AppSnapshot] = []
// this dummy data is for simulator (uncomment when testing ActiveAppsWidget pagination)
if (apps.count > 0){
let app = apps[0]
for i in 0..<10 {
let name = "\(app.name) - \(i)"
let x = AppSnapshot(name: name,
bundleIdentifier: app.bundleIdentifier,
expirationDate: app.expirationDate,
refreshedDate: app.refreshedDate
)
newSets.append(x)
}
apps = newSets
}
return apps
}
}
#endif