This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
@StateObject var service = ChatGPTService() | |
@State var textResponse = "" | |
var body: some View { | |
VStack { | |
Text("Bot says: \(textResponse)") | |
Button { | |
Task { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ARKit | |
import Combine | |
import RealityKit | |
import SwiftUI | |
@main | |
struct MyApp: App { | |
var body: some Scene { | |
WindowGroup { | |
ContentView() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Combine | |
import PDFKit | |
import SwiftUI | |
struct ContentView: View { | |
@StateObject var manager = PDFManager() | |
@Binding var document: PDFTrapperDocument | |
@State var showScanner = false | |
@State var isEditing = false | |
var fileURL: URL? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct QuickLookController: UIViewControllerRepresentable { | |
var startEditing: PassthroughSubject<Void, Never> | |
var url: URL | |
var endEditing: () -> Void | |
func makeUIViewController(context: Context) -> PreviewControllerHolder { | |
PreviewControllerHolder(url: url, startEditing: startEditing, endEditing: endEditing) | |
} | |
func updateUIViewController(_ viewController: PreviewControllerHolder, context: Context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Combine | |
import QuickLook | |
class PreviewControllerHolder: UIViewController { | |
var cancellables = Set<AnyCancellable>() | |
var url: URL | |
var startEditing: PassthroughSubject<Void, Never> | |
var endEditing: () -> Void | |
var previewController = QLPreviewController() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct PDFTrapperApp: App { | |
var body: some Scene { | |
DocumentGroup(newDocument: PDFTrapperDocument()) { file in | |
ContentView(document: file.$document, fileURL: file.fileURL) | |
} | |
} | |
} |