mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
32 lines
702 B
Swift
32 lines
702 B
Swift
//
|
|
// PageInfoManager.swift
|
|
// AltStore
|
|
//
|
|
// Created by Magesh K on 11/01/25.
|
|
// Copyright © 2025 SideStore. All rights reserved.
|
|
//
|
|
|
|
// This is a utility class
|
|
class PageInfoManager {
|
|
static var shared = PageInfoManager()
|
|
private var pageInfoMap: [Int: NavigationEvent] = [:]
|
|
|
|
private init() {}
|
|
|
|
func setPageInfo(for key: Int, value: NavigationEvent?) {
|
|
pageInfoMap[key] = value
|
|
}
|
|
|
|
func getPageInfo(for key: Int) -> NavigationEvent? {
|
|
return pageInfoMap[key]
|
|
}
|
|
|
|
func popPageInfo(for key: Int) -> NavigationEvent? {
|
|
return pageInfoMap.removeValue(forKey: key)
|
|
}
|
|
|
|
func clearAll() {
|
|
pageInfoMap.removeAll()
|
|
}
|
|
}
|