Modifying a @FetchRequest : <p>Xcode beta 5 introduced <code>@FetchRequest</code> for SwiftUI.</p>

<p>I have a View, which has a <code>@FetchRequest</code>. The <code>NSFetchRequest</code> is created within a manager that makes a static instance of itself available to property wrappers (they cannot use self). The same instance is passed to the view at creation. </p>

<p>What I want is for the <code>FetchRequest</code> to be updated, when <code>self.manager.reverse.toggle()</code> is called, in order for the view to change its ordering of objects. Unfortunately it seems like <code>Manager.fetchRequest()</code> is only called once and then never again, even when I create new objects and transition between different views. </p>

<p>I am looking for suggestions on how to modify a fetch request that is made with the new property wrapper, so that I can resort my objects based on user actions.</p>

<pre class="lang-swift prettyprint-override"><code>struct MainView: some View {
    @ObservedObject var manager: Manager

    @FetchRequest(fetchRequest: Manager.shared.fetchRequest())
    var ts: FetchedResults

    var body: some View {
        NavigationView {
            List(ts, id: \.self) { t in
                Text(t.name)
            }
        }.navigationBarItems(trailing:
            Button(action: { 
                self.manager.reverse.toggle() 
            }) { Text("Reverse")}
    }
}

final class Manager: ObservableObject {
    @Published var reverse: Bool = false

    // Since property wrappers cannot use self, we make a shared instance
    // available statically. This same instance is also given to the view. 
    public static let shared = Manager()

    func fetchRequest(reverse: Bool = false) -&gt; NSFetchRequest&lt;T&gt; {
        let request: NSFetchRequest&lt;T&gt; = T.fetchRequest()

        request.sortDescriptors = [
            NSSortDescriptor(
                key: "name",
                ascending: !self.reverse
            )
        ]

        return request
    }
}
</code></pre>
