From 2873de3b4c5d709c102536499341d91aa8626b10 Mon Sep 17 00:00:00 2001 From: Constantin Clerc Date: Thu, 21 Dec 2023 22:51:45 +0100 Subject: [PATCH] FINALLY fixed scrolling --- Geranium/GeraniumApp.swift | 3 +++ Geranium/HomeView.swift | 13 +++++-------- Geranium/Libs/Addon.swift | 13 +++++++++++++ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Geranium/GeraniumApp.swift b/Geranium/GeraniumApp.swift index bdf175a..11d336a 100644 --- a/Geranium/GeraniumApp.swift +++ b/Geranium/GeraniumApp.swift @@ -36,7 +36,10 @@ struct GeraniumApp: App { } task.resume() } + #if targetEnvironment(simulator) + #else sendLog(RootHelper.loadMCM()) + #endif } .sheet(isPresented: $isFirstRun) { if #available(iOS 16.0, *) { diff --git a/Geranium/HomeView.swift b/Geranium/HomeView.swift index fa57cf4..6f57832 100644 --- a/Geranium/HomeView.swift +++ b/Geranium/HomeView.swift @@ -45,11 +45,6 @@ struct HomeView: View { respring() }) .padding() - Button("Reboot", action: { - killall("com.apple.launchd") - killall("launchd") - }) - .padding() Button("Rebuild Icon Cache", action: { UIApplication.shared.alert(title:"Rebuilding Icon Cache...", body:"Please wait, your phone until your phone repsrings.", withButton: false) let output = RootHelper.rebuildIconCache() @@ -67,7 +62,7 @@ struct HomeView: View { .ignoresSafeArea() } Text("") - List { + List() { Section (header: Text("Credits")) { LinkCell(imageLink: "https://cdn.discordapp.com/avatars/470637062870269952/67eb5d0a0501a96ab0a014ae89027e32.webp?size=160", url: "https://github.com/bomberfish", title: "BomberFish") LinkCell(imageLink: "https://cdn.discordapp.com/avatars/396496265430695947/0904860dfb31d8b1f39f0e7dc4832b1e.webp?size=160", url: "https://github.com/donato-fiore", title: "fiore") @@ -75,8 +70,10 @@ struct HomeView: View { LinkCell(imageLink: "https://avatars.githubusercontent.com/u/85764897?s=160&v=4", url: "https://github.com/haxi0", title: "haxi0") } } - // https://stackoverflow.com/a/75516471 - .simultaneousGesture(DragGesture(minimumDistance: 0), including: .all) + .disableListScroll() + .onAppear { + UITableView.appearance().isScrollEnabled = false + } } } .toolbar{ diff --git a/Geranium/Libs/Addon.swift b/Geranium/Libs/Addon.swift index 27db0e8..32b9f5e 100644 --- a/Geranium/Libs/Addon.swift +++ b/Geranium/Libs/Addon.swift @@ -312,3 +312,16 @@ func SuccessfulOrWhat(_ inputBoolean: Bool) -> String { return "Error" } } + +// https://stackoverflow.com/a/76762126 +extension View { +@ViewBuilder +func disableListScroll() -> some View { + if #available(iOS 16.0, *) { + self + .scrollDisabled(true) + } else { + self + .simultaneousGesture(DragGesture(minimumDistance: 0), including: .all) + } +}}