DEV Community

Discussion on: How to make a task list using SwiftUI and Core Data

 
maeganwilson_ profile image
Maegan Wilson

You can, but the @Environment and @FetchRequest are used with SwiftUI views. I wouldn't move the @Environment to make sure that there is a context associated with the view. I also like to leave my FetchRequests in the view because that's where I need the data to be viewed.

Thread Thread
 
cpiersigilli profile image
Cesare Piersigilli

Your explanation convinced me. Thank you.