Help I have a big problem with my School Project

Help!
If got a school project and if got this following code. And there is this one error and I don’t know how to fix it.
Error


: Value of type “ContentView” has no subscripts

You will not find many answers in the Swift forums concerning SwiftUI questions, but on the language side a subscript is something that you write as "...[...]", so "self" does not have such a subscript here, you cannot use self[index]. See what ''self" is in this case (use quick help in Xcode) and see if this is indeed what you would like to use here.

1 Like

Hi,
the error occures because you are trying to access self[index] where selfis the ContentView which has no subscripts.
I think you want to access currencies[index]. But without the full code it is hard to guess.