Two Fields, two values(x & y), if field1 has x, field2 has y

I have 2 values ( x & y), and two fields. Field1 is a picker to select either x or y. If the picker selects x, the second field will show y, and vice versa. I have tried If with no success. Can anyone please assist.

This is a forum for topics related to Swift Language itself only.

It looks like you are creating GUI in SwiftUI. SwiftUI is a framework which happens to use Swift.

If you need more help, this tutorial will help you get started with SwiftUI: Introducing SwiftUI