SwiftUI Multiplatform Endpoint Pickers Question #170
Replies: 2 comments 1 reply
-
Yes, I can see the selected endpoint is saved, but so are the created Test endpoints. Every time I create a new endpoint is gets saved automatically. So the project automatically saves a created endpoint, but doesn't delete a saved one that is destroyed. Same with not reloading any saved endpoints between project runs. I can understand that a simple example might not include this, but I can't really see how to do it myself, without a lot of experimentation. Is there an API to do it that I am missing? Thanks! |
Beta Was this translation helpful? Give feedback.
-
When you're the "owner" of an endpoint it's your responsibility to restore this ID every time you create the "same" endpoint so that other software can identify it with a stable identity. When you create virtual endpoints, the API allows you to automatically manage unique ID persistence. If you look at the To be clear, the example project is playing the role of both provider and consumer of endpoints. It is then saving:
I'm not seeing this happen on my end. Did you modify the project in some way that might have caused that? The plist remains consistent with only these keys: |
Beta Was this translation helpful? Give feedback.
-
I am experimenting with this example and there is something I don’t quite understand regarding how created endpoints are saved.
When I press the Create Test Virtual Endpoints button the 4 endpoints appear in the prefs file straight away, however when I rerun the project, the popup is not populated with these saved endpoints. Also when destroying these endpoints, the items are not removed from the preferences.
I only noticed this when creating and destroying endpoints that I create myself and noticed the prefs file was full of dozens of previously saved and destroyed endpoints.
Is this a bug or something I don’t understand how the project is supposed to work?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions