Fetch data from CoreData for iOS 14 widget

I want to display data fetched from Core Data in a widget. But @FetchRequest doesn’t work on widgets.

As I understand, we have to create an app group and make a shared persistent container.

What I want to know is how to read (fetch) data on widgets from that shared persistent container. 
or simply, how to display data fetched from Core Data in widgets.

Please help me. Thanks.
Accepted Answer
Follow this solution on StackOverflow to fetch data from CoreData for iOS 14 widgets
Fetch data from CoreData for iOS 14 widget
 
 
Q