0 Replies
      Latest reply on Sep 9, 2019 6:20 AM by an-erd
      an-erd Level 1 Level 1 (0 points)

        I want to drive SwiftUI views with the new @FetchRequest property wrapper from the results of a fetch request. The first level, so just using a Text in the same struct where the fetch request is used, works fine and the view is updated if core data changes. If I integrate a

        LandmarkRow(landmark: landmark)

        this will not be updated anymore (but if copied the exact same code to the main view, it works)

         

        Essentially I want to include views with the details as in the landmarks tutorial:

        ForEach(userData.landmarks) { landmark in 
            if !self.userData.showFavoritesOnly || landmark.isFavorite { 
                NavigationLink(destination: LandmarkDetail(landmark: landmark)) { 
                    LandmarkRow(landmark: landmark) 
                } 
            } 
        }

         

        Maybe there is a tutorial or some more information on how to use @FetchRequst and inherited views correctly?

         

        Any idea on how to proceed?