mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
37 lines
1.0 KiB
Swift
37 lines
1.0 KiB
Swift
//
|
|
// 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
|
|
|