|
This is, in part, a follow-up to my question last week. I have an enum of options for filtering in my library management app:
All but the last two options are fairly straightforward text-filtering for which I adapted this HWS+ tutorial. The last two require picker views, however. But I'm running into a strange problem when I attempt to work those picker views into a view that encompasses all the optios: This works as intended:
This, however, does not:
Which... doesn't make sense to me. The only difference between the two (at least so far as the picker portion is concerned) is that instead of:
I'm using:
I can get around it by bypassing
But I'd much rather understand WHY it isn't working, rather than just getting around it with guesswork. |
|
Hey, it's me again 😂 TLDRThe only thing you're missing is an
block on your DisclaimerI don't have all the code back code you have, so I had to simplify it quite a bit, but it should work nonetheless. Here's the view I am using:
Notable changes I made:
None of those changes should break the answer. Now the actual answerThe first step I take when debugging something like this is to check whether your
When you run it you see your rating variable is changing as expected, so the issue isn't with the picker but with the list showing the filtered information. Which brings me to the issue you have: you're never updating your
Full view:
|
|
|
|
Thank you again, @jakcharvat. I very much appreciate you taking the time to help me with this. I actually did discover Thank you again. |
|
Thanks so much for the compliment Paul, really means a lot to me. @NCrusher74, happy to help, please let me know if it worked, if not I'd love to dig in a bit deeper and try to debug it with you :) |
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.
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.
Link copied to your pasteboard.