|
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 Play is the first native iOS design tool created for designers and engineers. You can install Play for iOS and iPad today and sign up to check out the Beta of our macOS app with SwiftUI code export. We're also hiring engineers!
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.