Projections
            
            #7605
          
          
        Replies: 1 comment
-
| 
         The main benefit is that ViewModels build on Projections stay observable. So you can bind their properties directly in SwiftUI, and the views will automatically update when anything changes. If you manually build the ViewModel by copying the individual values, you will also have to observe all of them and manually pass on the change events to the UI as they happen. Projections saves you all that work. Think of them as a ViewModel construction kit 😉.  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all!
Realm Swift 10.21.0 includes the new
Projectionfeature. I'm just a bit curious as to the main purpose of this.For the given
Personexample, is there any advantage to using aPersonProjectioninstead of creating my ownViewModeltype? i.e.Does it optimise queries deep in Realm, or is the feature more about creating a convenient re-usable projection type for use in View Models?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions