GO FURTHER, FASTER: Try the Swift Career Accelerator today! >>

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      

Hacking with Swift is sponsored by Essential Developer.

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until February 9th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

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.