Relation

The ContactRelation model represents a relationship between a contact and another person in the ContactsManager SDK.

Properties

  • relationId: String - Unique identifier for the relation entry
  • name: String? - Name of the related person
  • relationType: String? - Type of relationship (spouse, child, parent, friend, etc.)
  • notes: String? - Additional notes about the relationship
  • contact: Contact? - Reference to the parent contact that owns this relation

Usage Example

// Create a relation
let relation = ContactRelation(
    contactId: "contact-123",
    name: "Jane Doe",
    relationType: "spouse",
    notes: "Married since 2015"
)

// Add to a contact
contact.relations.append(relation)

// Access from a contact
if let firstRelation = contact.relations.first {
    print("Relation: \(firstRelation.display())")
}