UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

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


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 April 28th.

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.