Reputation: 1555
I'm building a video feed feature in our SwiftUI app which is very similar to a TikTok feed. We fetch the video URLs remotely and then the user scrolls through the videos which should autoplay for them.
Obviously user expectation for this kind of feature is that the scroll is seamless and we want to avoid any loading time where possible. I've tried to implement this by building my own local video cache, but it's still not as performant as I'd like it to be. My idea was that I'd pre-cache the next, say, 3 videos so that by the time the user scroll to them, we can use the cached file. However, fast scrolling still causes an issue and it is definitely not as smooth an experience as a user would expect.
After some research I came across the IGListKit
framework which seems like it may have a lot of built in features that would help with this video feed. However, as we are building the app mainly in SwiftUI and it seems IGListKit
works in conjunction with UICollectionView
s, I wondered if this is really the best route to go down. Are there any other frameworks that I'm missing that might work more seamlessly with SwiftUI? Or is IGListKit
the best way to go?
Upvotes: 2
Views: 305