Search code examples
iosswiftcore-datatoday-extension

How to show data from app to Today Extension Swift


I have a app with data stored in core data but I also need to pass that data to my today extension. I was trying to do it with core data but it doesn't work. Maybe I would have to user userdefaults to pass the data from the app to the today extension.

Any help will be greatly appreciated.


Solution

  • I think target only missing.

    Try like this

    Add today extension target membership for .xcodeModalId

    Step: Click on your model file, and select both targets under 'Target Membership' on right-hand panel