Member-only story
Widgets in iOS 14 are pretty awesome and with SwiftUI now developers can be more creative with how they can show information from their app which matters to the user
Widgets do not support scrolling at the moment and maybe this is one of the reason why you cannot use List in Widgets but nevertheless we can still create our UI to make it look like a list but without the scrolling.
I was working on widgets and wanted to show a list of items from core data, so I assumed that if I want to show a list of items in a widget then perhaps I should use the List container
However, when I did use the list container and ran the preview, it seemed like widget kit was just asking me to stop as you can see in the below image
Which is obvious because widgets do not support scrolling and this is the default behavior it seems, so giving it a thought I had a theory which I wanted to test it out to see if that would work and it did
Given are the steps that I tried just to test out a theory I had
- I created a structure and made it implement the Identifiable protocol