Good day,
I have hard data in the form of an array (which will eventually be replaced by a CMS) on one view. This view creates card like tiles that displays a bit of data from that array list items. I then would like to display that data in full again, in a different view when the user clicks on one of the tiles. I am very very new to SwiftUI, please forgive me.
I believe that I must use @ObservableObject and @ObservedObject, but I am unsure how to apply it. Below is a code snippet...
Now, in the view that this is in I can simply just define that those items are strings, then call them as shown below, but I am unsure how I could call it on a whole different view?
I have hard data in the form of an array (which will eventually be replaced by a CMS) on one view. This view creates card like tiles that displays a bit of data from that array list items. I then would like to display that data in full again, in a different view when the user clicks on one of the tiles. I am very very new to SwiftUI, please forgive me.
I believe that I must use @ObservableObject and @ObservedObject, but I am unsure how to apply it. Below is a code snippet...
Code Block swiftui var draftData = [ Draft( title: "Beer 1", type: "NEIPA 7.5%", desc: "This beer x y z 1 2 3 description here."), Draft( title: "Beer 1", type: "NEIPA 7.5%", desc: "This beer x y z 1 2 3 description here."), Draft( title: "Beer 1", type: "NEIPA 7.5%", desc: "This beer x y z 1 2 3 description here."), ]
Now, in the view that this is in I can simply just define that those items are strings, then call them as shown below, but I am unsure how I could call it on a whole different view?
Code Block Text(draft.title)