|
I have a roster that I would like to sort by active. I am struggling trying to see if the array should be sorted before the ForEach or using the ForEach. Thank you! Bob
|
|
Robert asks for business logic advice:
Write yourself a note on a 3x5 index card and post it near your monitor. Write something like "SwiftUI is a declarative language!" Add emojis or smiley faces, what ever works. When you get stuck, refer to this note! Think of Answer: You are building an
Declare your intentionsNext, look at the index card. Ponder the declarative nature of SwiftUI. You're in charge! Tell the For this, you may have to go back to your original In your
You can embed the selection and the sorting logic within your Then building your views becomes a trivial matter of (checks index card) declaring(!) what you want to see in the view.
Hope this helps. |
|
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.
Sponsor Hacking with Swift and reach the world's largest Swift community!
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.