2025-01-10 08:11:35 +05:30
|
|
|
//
|
|
|
|
|
// ActiveAppsTimelineProvider+Simulator.swift
|
|
|
|
|
// AltStore
|
|
|
|
|
//
|
|
|
|
|
// Created by Magesh K on 10/01/25.
|
|
|
|
|
// Copyright © 2025 SideStore. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Simulator data generator
|
2025-01-11 03:25:25 +05:30
|
|
|
#if targetEnvironment(simulator)
|
2025-01-10 08:11:35 +05:30
|
|
|
@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]
|
2025-01-11 03:25:25 +05:30
|
|
|
for i in 1...10 {
|
2025-01-10 08:11:35 +05:30
|
|
|
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
|
|
|
|
|
|