|
So, I have been refactoring my views, which took a bit to get used to.. Now I have a view that is for Attendance, I have a picker and an enum. What I would like to do, is to be able to select the period of the class being taught, and the cooresponding class being taught, i.e firstPeriod be shown. I think that I would need to keep the picker in the Attendance view, and once the user selects the class period. The selectedPeriod is sent to the roster.swift file where the students in firstPeriod are selected and returned as a view. (keeping the sorting and etc. out of the view). Am I thinking correctly on this? Thank you. Bob See below for my Attendance View.
|
|
Hi blawson3, There maybe a more efficient way of doing this and I am sure others may provide this however this approach should work for you.
In order to make this code work for your use case you can swap out Class1 and Class2 in the initialiser for any array of students from your Roster model. Hope this helps. |
|
Thank you, I will need to look closely at this to make sure that I can understand it, (still a beginner). Thank you!! Bob |
|
I am in learning process but will try My best to learn and do it for my https://www.lifepo4golfcartbattery.com/ business |
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
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.