Im not sure if this is even possible. I have a view that takes in a string parameter. Then in that same view I was to initialize a @State variable to a set of data I will load which I want other views to be able to access. However, in order to load that data set I need the value of that passed in string parameter.
I'm getting the "Cannot use instance member 'chosenStoryNameIn' within property initializer; property initializers run before 'self' is available". Is there some wait to work around this?
struct shortStoryView: View {
@State var chosenStoryNameIn: String
@State var showPopUpScreen: Bool = false
@State var showQuestionDropdown: Bool = false
@State var data: shortStoryData = shortStoryData(chosenStoryName: chosenStoryNameIn)
var body: some View {