title: SwiftUI & CloudKit - CoreData Many to Many Relationships
body: <p>I am new to Swift UI and working as well for the first time with CoreData and CloudKit. A lot of my questions could already be answered by existing tutorials or similiar already answered questions. But I couldnt find a great resource for Many to Many Relationships in CoreData.</p>
  <p>In my project the user can save markers/timestamps by pushing a button, which triggers a function saving the data in CoreData. When the recording, during the user can save timestamps, is finished by a button press a function saves the recording to CoreData. My aim is that the recording saves and includes all created and saved markers/timestamps, so the user can click in i his history on a Project/Recording and gets all markers/timestamps for this recodring.</p>
  <p>At that point I can save and create a marker and recording but not link them to each other.</p>
  <p>How can I do it the easiest way - with a Many to Many Relationship? How do Many to Many Relationships work in my code?</p>
  <p>I would be really thankfull for help and ideas!</p>
  <p>Robert
  PS: On the phtos you can see that I already tried to create Relationships, but I can't create them with a function...</p>
  <p><a href="https://i.stack.imgur.com/fxkfZ.png" rel="nofollow noreferrer">Data Model</a></p>
  <p><a href="https://i.stack.imgur.com/i8pTu.png" rel="nofollow noreferrer">Functions</a></p>
  <p><a href="https://i.stack.imgur.com/OA15r.png" rel="nofollow noreferrer">Relationships</a></p>