SwiftUI-Kit icon indicating copy to clipboard operation
SwiftUI-Kit copied to clipboard

Modeling

Open jordansinger opened this issue 3 years ago • 2 comments

How should we be thinking about modeling the views, especially those that differ by platform and as the repo grows over time?

Could imagine the #if method getting messy.

As I was building this in the first place, I imagined making a struct to hold each grouping and an array of views inside of it. Curious if there are other suggestions and if doing this might be overkill?

jordansinger avatar Jul 12 '20 18:07 jordansinger

What if you were to use Modules for each platform? That way it won't be messy and shared code (views) can be shared and reused. But it needs a little hustle to implement.

ivanglushko avatar Jul 12 '20 19:07 ivanglushko

I agree that we should have a better way than all this #if os() in the middle of the code.

We also should come up with a good way to handle the different modifiers. E.g. in the ProgressView has a CircularProgressViewStyle which we only show on watchOS, although it is available on all Platforms. We don't show it because on the other platforms it is the default style.

Nef10 avatar Jul 13 '20 01:07 Nef10