Skip to content

Commit

Permalink
display success/error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuowei committed Feb 4, 2023
1 parent bd46aba commit 0e6a792
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion WDBRemoveThreeAppLimit/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
}) {
Expand Down

0 comments on commit 0e6a792

Please sign in to comment.