|
Hi, I finnished Day 59. Now I want to consolidate my knowledge a bit. I came up with a project that would also have a practical use for me. I want to create a shift planner. It should be able to create shifts for several employees of a company. The first step in planning is for me to create the model correctly. I do this because I'm not very good at it. This will help me improve my skills. I was planning the "Shift" like this:
The rest is not ready to publish. I think my solution is not good. I guess it would be better, when I organize Shift.modules in a dictionary with the ShiftAlteration as a key instead of an array. But let me know your oppinion. |
|
One thing you might do is change
And then you don't have to worry about More comments: Do you really need both a You have You use Depending on how you envision I'll have to think about it some more, but I'm wondering if your modeling of a shift should perhaps be reworked. I almost think |
|
Thank you for your suggestions. I really appreciate that. TOP: TOP: TOP: https://www.dropbox.com/s/dseozemdpf9vuxg/Bildschirmfoto%202022-02-12%20um%2007.43.14.png?dl=0 Sorry i couldn't figure it out, how to attach an image here. The image shows the creation of a shift. |
|
You can embed an image in your post by doing the following:
So:
results in: |
|
As for the actual design and stuff... I think I get it now. So every If my understanding is correct, here's what I'd do:
|
|
BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.
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.