Sharing Flow
Share Creation (Owner)
Step 1: Initiate Share
func createCKShareIfNeeded() async {
let company = selectedCompany
// Check for existing share
let shares = try? container.fetchShares(matching: [company.objectID])
if let existing = shares?[company.objectID] {
presentShareController(with: existing)
return
}
// Create new share
let (_, share) = try await container.share([company], to: nil)
// Enlist all company data
await enlistAllCompanyData(company, into: share)
presentShareController(with: share)
}Step 2: Enlist Related Data
Step 3: Present Share UI
Step 4: Generate Share URL
Share Acceptance (Participant)
Step 1: Open Share URL
Step 2: Extract Metadata
Step 3: Accept Share
Step 4: Sync to Shared Store
Ongoing Sync
New Data (Owner Creates)
New Data (Participant Creates)
Removing Participants
Stopping Sharing
Last updated