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

Looking for some guidance on a seating chart

Forums > SwiftUI

So I have been looking at the new Grid(Beta) in iOS16. I would like to develop a seating chart, so I am in the process of looking at how to complete the following:

  • Allow for a variety of class sizes.
  • Allow for a non-traditional (i.e. Rows and Columns) arrangement, groups of four desks, etc.
  • Allow for a custom desk arrangement to be saved (and used in other classes).
  • Ability to drag and drop desks (possibly even rotate 90 degrees)
  • Allow for an attendance feature.

I've been looking at the Stanford CS Videos, and possibly using some of that info for drag and drop. I've also been playing around with the Grid(Beta), trying to implement the hidden().

Any help is greatly appreciated.

Thank you,

Bob

2      

Bob shares an excellent vision:

I would like to develop a seating chart. Here are some ideas... ...snip.....
Any help is greatly appreciated. I appreciate any help!

Excellent!

Break your big problem into several smaller problems. Solve the smaller problems one at a time. As you fix design issues in your smaller problems start to think about how you can refactor your code to make reusable components for your next set of goals.

Since you asked...

A seating arrangement, and attendence feature suggests you'll have students and seminars.

Rows and columns, special grids, and possibly group discussion (circles!) arrangements suggests desks and chairs.

I would suggest you start by addressing these as separate problems. Maybe you first figure out what data you'll collect for each person in your classroom, or seminar. What data is necessary to completely describe a single student?

Then maybe consider describing a seminar group. How many students per seminar? Any extra seats for guest lecturers, or drop-in administrators? A seminar object might describe the time, session, title, instructors, assistants, description of the course being taught. Perhaps even contain a set of student objects assigned to that particular session.

Next consider developing a shape arrangement solution independent of your student, or seminar objects. Have a struct that takes a given number of box objects. From an enum of possibilities, allow the interface to provide standard setups such as traditional grids, semi-circles, full circles, etc.

At some point you can match students in a seminar to the desks in an arrangement.

Sounds like a fun project! Keep us updated!

2      

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!

Archived topic

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.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.