mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-16 18:23:53 +01:00
More improvements and fixes (see commit description)
- put SwiftUI in an unstable feature - Add Reset adi.pb to SwiftUI settings - Add localizations to more things such as Error Log and Refresh Attempts - Move debug logging into Advanced Settings - Add padding to version text at the bottom of SwiftUI settings - Add some things to Unstable Features such as nesting the Feature enum in UnstableFeatures and allowing on enable/disable hooks - Don't use ObservableObject for UnstableFeatures as it's not needed - fix a bug with unstable features where the toggle would be reverted if you go into another tab and then back - Use SwiftUI advanced settings in UIKit
This commit is contained in:
30
AltStore/Unstable Features/UnstableFeatures+SwiftUI.swift
Normal file
30
AltStore/Unstable Features/UnstableFeatures+SwiftUI.swift
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// UnstableFeatures+SwiftUI.swift
|
||||
// SideStore
|
||||
//
|
||||
// Created by naturecodevoid on 5/25/23.
|
||||
// Copyright © 2023 SideStore. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import UIKit
|
||||
|
||||
import AltStoreCore
|
||||
|
||||
extension UnstableFeatures {
|
||||
class SwiftUI {
|
||||
static func onEnable() {
|
||||
let rootView = RootView()
|
||||
.environment(\.managedObjectContext, DatabaseManager.shared.viewContext)
|
||||
|
||||
UIApplication.shared.keyWindow?.rootViewController = UIHostingController(rootView: rootView)
|
||||
}
|
||||
|
||||
static func onDisable() {
|
||||
let storyboard = UIStoryboard(name: "Main", bundle: .main)
|
||||
let rootVC = storyboard.instantiateViewController(withIdentifier: "tabBarController") as! TabBarController
|
||||
|
||||
UIApplication.shared.keyWindow?.rootViewController = rootVC
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user