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

Challenge 1 Problem with Selecting Different Measurement Styles

Forums > SwiftUI

Hello guys, i was curious as to how to get the Picker to let me select different measurements? I tried a ForEach and it kind of just broke the code and wouldn't let me pick a different one. I've been slowly chipping away at it and haven't gotten too far with it. The length selection is me just trying to different ways to get it to work. I tried creating an array of different unit outputs, but when I tried id: .self it just gave me the same name. I know that having different Strings in the Text field is why it's not letting me select different ones, but I'm just not sure on how to get the Picker to let me select a different one. Not close to being done, but working on it each day.

Any help is much appreciated, thank you!! https://imgur.com/a/9Gjgxbn

1      

Hacking with Swift is sponsored by Alex.

SPONSORED Alex is the iOS & Mac developer’s ultimate AI assistant. It integrates with Xcode, offering a best-in-class Swift coding agent. Generate modern SwiftUI from images. Fast-apply suggestions from Claude 3.5 Sonnet, o3-mini, and DeepSeek R1. Autofix Swift 6 errors and warnings. And so much more. Start your 7-day free trial today!

Try for free!

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

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.