NEW: Learn to build the incredible iOS 15 Weather app today! >>

Ultimate Portfolio and Widgets - share info from Core Data & persistent storage migration

Forums > Videos

I have just been through the couple of videos regarding Widgets that Paul made last year. Very interesting stuff.

Of course what some, me included, would like to do is to link some data from their main app to the widget. I know that widgets are meant to be light on processing time and minimal interaction. If and until Apple provide some mechanism for transfering some data from the app to the widget in a convenient manner, there are a few ways that that could be achieve this, as suggested on other forums and discussions groups - namely a shared file access or using app user defaults.

If using Core Data and persistent storage, to be able to share the data between the app and the widget you need to have started the development with this in mind and set up an App Group from the outset.

I have also been following the Ultimate Portfolio videos, where the Core Data and persistent storage are in the App. To be able to add a widget that uses data from the App, it would be necessary to migrate (lightweight migration?) the persistent storage from the App to the App Group.

I hope that Paul will cover the creation of a widget in the Ultimate Portfolio videos (part 2 or part 3), and how we could migrate the persistent storage. At least that is my wish.


Hacking with Swift is sponsored by Essential Developer

SPONSORED Only until this Sunday, December 12th, you can join a free crash course to learn advanced techniques for testing new and legacy Swift code — it's the fast track to becoming a complete Senior iOS Developer!

Click to learn more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.