From 0e6a792989aa9fe71951d1c08a1b7b519ddb011e Mon Sep 17 00:00:00 2001 From: Zhuowei Zhang Date: Sat, 4 Feb 2023 10:13:03 -0500 Subject: [PATCH] display success/error messages --- WDBRemoveThreeAppLimit/ContentView.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/WDBRemoveThreeAppLimit/ContentView.swift b/WDBRemoveThreeAppLimit/ContentView.swift index 96fa96b..0ad61e6 100644 --- a/WDBRemoveThreeAppLimit/ContentView.swift +++ b/WDBRemoveThreeAppLimit/ContentView.swift @@ -8,20 +8,31 @@ import SwiftUI struct ContentView: View { + @State private var message = "" var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundColor(.accentColor) - Text("Hello, world!") + Text(message) Button(action: { grant_full_disk_access { error in if let error = error { print(error) + DispatchQueue.main.async { + message = "Failed to get full disk access: \(error)" + } return } if !patch_installd() { print("can't patch installd") + DispatchQueue.main.async { + message = "Failed to patch installd." + } + return + } + DispatchQueue.main.async { + message = "Success." } } }) {