BLACK FRIDAY: Save 50% on all my Swift books and bundles! >>

Picker not showing selection

Forums > iOS

I'm in the course "UltimatePortFolio" at point 7 ("Editing Items") I Use Xcode 16, and the effect is that when I implement the prioriity-picker only the symbol for up and down is shown. I make a little sample and I'vethe same problem

import SwiftUI

struct ContentView: View {
    @State private var selectionChoice = 0
    var body: some View {
            Picker("Priority", selection: $selectionChoice) {
                Text("Low")
                Text("Medium")
                Text("Hight")
            }
     }
}

Is this a global problem?

The Problem "disappeares" when I add the .tag(Int16value))

1      

If it's difficult to read your code, you'll find we'll still help. However, if your code is easy to read, it's simple for us to copy and paste it into our own Xcode to try.

Regular contributor @roosterBoy gave great advice about posting code. It's easy! Just follow the markup rules.

See -> How to post code

Keep Coding

   

Thanks for the hint

   

Here's another hint.

You can click the document-and-pencil icon in your first message. This allows you to edit your original post to format the Swift code you originally posted!

1      

Save 50% in my WWDC sale.

SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.