How Do You Update An Upper Text View?

I must be tired or something because I can't work out how to update my upper text view. What I need is this something like this....

If buttonclick then
mytext(1).text = "You clicked the button."

My button is below my text view so I don't know what to do.

What am I missing? How do I do this?

Thanks.

It's not obvious what you are asking here, but anyways, this is a forum for topics related to Swift language itself, not about SwiftUI / UIKit or other close source Apple frameworks. Try asking on Apple Developer Forums or stackoverflow.

What I'm asking here is for some help with my Swift code. More specifically, I'm trying to update a text view when a user taps on a button that is located below the text view. But I can't work out how. Sorry, I should have said before that this is for an iPhone app.

As @tera said, this is a forum for topics related to Swift language itself.

But if you are writing your GUI code in SwiftUI, this tutorial will help you get started: Introducing SwiftUI.