How do I use @FetchRequest
with a CoreData
entity Post
that has Codegen: Class Def.
set in Xcode
? So I don't create the Post
" entity class manually, but let Xcode generate it?
I now get a
Use of undeclared type
Post
as an error on the last line.
@FetchRequest(entity: Post.entity(), sortDescriptors: [
NSSortDescriptor(keyPath: \Post.date, ascending: true)
])
var posts: FetchedResults<Post> // Use of undeclared type ´Post´
Post
definition? – Pankaj Kulkarni