iCloud Sharing

hello Developers, I am new to CloudKit and I am trying to figure out iCloud Sharing however the docs aren't the best for some reason. if anyone could give me an example of how to save a CKShare and Accept it that would be amazing Thank you so much. 🙂