Absolutely, sorry for the opacity.
First and foremost, the Pickerview takes a bound set as a parameter. I know while testing I am using a set as a parameter, but I really need to figure out how to redesign and take an array as a parameter instead. I believe the selection of colors has to be a set. So I will need to accept a Bound array, transform it into a set for use, and then back to an array again to get the bound value to update in my parent view...
My reason for doing so is that all the rest of my data is Array based. So with hope of making this a very reusable piece of code, I either will need to make it accept an array, or I will have to do the opposite transformation dozens of times in the parent views.
As to the other stuff...
First whenever you add or delete colors using the Pickloader view, it doesn't update the list view until you exit and reload the view, or change a second item. Similarly, if you make changes, and then click the button at the bottom to reset to defaults, or clear the list entirely, it does what it says, but it does not update the view until the next change is made. It's like the view is always one step behind the actions. I am trying to use the list of colors stored in userDefaults directly, and I think I am going to need to copy it out, use it, and then save it back later... Not sure.
With regard to deleting choices that are being used, this can be demonstrated by viewing the canvas preview with preset data. I have it set up for Red and Blue. When you run that preview, it works perfectly, setting up Red and Blue as the choices, and allowing you to edit them and returning the edited set. However, if you then were to delete one of the colors - red or blue - and go back, you will find that it is listed in the selection set still, but can't be deleted or changed. The only way to remove it currently would be to add it back in to the list of choices.
My plan there was to eventually check any presets passed in to verify it is in the current list, and add anything in that isn't in the list.
I think I can figure out the rest of this stuff, though I am certainly not turning away advice! May take me a while, but I think I know what to do there. I am drawing dead with respect to the first issue, though. I know it works right now, but I need to work with array's, not sets. I either will need to do this once here, or the reverse a dozen times over on the other side. For the life of me I cannot figure out how to get it to work.
Thanks for the response
ps I am trying to teach myself swift. I learned Cobol, fortran, and 6800 assembly back in the day, and been out of touch since. No sir I did not forget a zero on that number. Best way to learn is to do, so I have a Swift Data Model... Schools with classes full of teachers and students etc. Trying to put it all together. No other reason then to learn how to do it before I actually attempt something I care about.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: