Skip to content

Commit

Permalink
Console ?
Browse files Browse the repository at this point in the history
  • Loading branch information
c22dev authored Nov 28, 2023
1 parent da89973 commit 0dc72d1
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions TipsGotTrolled/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct ContentView: View {

var body: some View {
NavigationView {
VStack {
Form {
Section {
Button("Exploit") {
Expand Down Expand Up @@ -53,8 +54,39 @@ struct ContentView: View {
} footer: {
Text("Made by C22 and haxi0 with sweat and tears. TrollStore by opa334, method by Alfie.")
}
ScrollView {
ScrollViewReader { scroll in
VStack(alignment: .leading) {
ForEach(0..<LogItems.count, id: \.self) { LogItem in
Text("\(String(LogItems[LogItem]))")
.textSelection(.enabled)
.font(.custom("Menlo", size: 15))
}
}
.onReceive(NotificationCenter.default.publisher(for: LogStream.shared.reloadNotification)) { obj in
DispatchQueue.global(qos: .utility).async {
FetchLog()
scroll.scrollTo(LogItems.count - 1)
}
}
}
.frame(maxWidth: .infinity, alignment: .leading)
}
.padding()
.frame(width: UIScreen.main.bounds.width - 80, height: 300)
.background(Color(UIColor.systemGray6))
.cornerRadius(20)
}
.padding()
}
.navigationBarTitle(Text("TipsGotTrolled"), displayMode: .inline)
}
}
func FetchLog() {
guard let AttributedText = LogStream.shared.outputString.copy() as? NSAttributedString else {
LogItems = ["Error Getting Log!"]
return
}
LogItems = AttributedText.string.split(separator: "\n")
}
}

0 comments on commit 0dc72d1

Please sign in to comment.