UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Model backed by sqlite database

Forums > SwiftUI

Hi, I have an application that has a list of Theaters in an outline view. Selecting one Theaters, will show all the movies showing in that theater. Currently, the entire model is loaded from an sqlite database at startup and SwiftUI manages to display the right movies through the use of the selection that is passed through the views.

I want to move this from loading the entire database at startup, to only loading the movies from the sqlite database after the theater is selected.

I'm not sure how I would go about doing that when using SwiftUI, any pointers please ?

[edit] I know how to work with sqlite to get the data, i'm looking for more generic guidance on how to detect if the theater selection has changed and reload the store based on the new selection.

Thanks

3      

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

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.