I have a list of items, each of which has a navigation link. When triggered, it calls a UIViewController from SwiftUI, some data is manipulated and then it returns. The pdfsList array needs to be re-fetched when I return from the view controller. How do I make that happen?
struct ContentView : View {
@State var pdfsList: [PDFSummary] = Realm.studyHallRealm.objects(PDFSummary.self).sorted(by: { $0.name < $1.name })
var body: some View {
NavigationView {
List(pdfsList) { pdfSummary in
NavigationLink(destination: InterfaceController(url: pdfSummary.dynamicURL(), summary: pdfSummary)) {
Text(pdfSummary.name)
.foregroundColor(self.itemColor(pdfSummary: pdfSummary))
}
}.navigationBarTitle(Text("PDF Library (SwiftUI)"))
}
}