I am able to to populate my SwiftUi with this code in the ContentView with no problems. What I am trying to do is to recall my Array in a ForEach loop as a Function Call
Can someone tell me on how I can recall my @ObservedObject var networkStoryManager = StoriesNetworkManager() so that I can regain access to my Array. I am at a total loss on how to regain my Array. All I am trying to do is gain access of my array so that I can write some calls to it.
ForEach(networkStoryManager.stories) { story in
Print(story.event)
}
I have attached my Xcode Project to help me with the Func Call.
Thank you ahead of time for any help on this. For till now I have had no responses to my problem in the last 2 weeks. I am at a total loss of words.
struct ContentView: View {
@ObservedObject var networkStoryManager = StoriesNetworkManager()
var body: some View {
VStack{
List(networkStoryManager.stories) { story in
Text(story.event)
}
.padding(.leading)
.navigationBarTitle("Story")
.frame(minWidth: 0, maxWidth: 400, minHeight: 0, maxHeight: 595)
}
.onAppear {
self.networkStoryManager.fetchStoryData()
}
}
}