Address

The ContactAddress model represents a physical address associated with a contact in the ContactsManager SDK.

Properties

  • addressId: String - Unique identifier for the address entry
  • address1: String? - Primary address line (street address)
  • address2: String? - Secondary address line (apartment, suite, etc.)
  • city: String? - City
  • county: String? - County or district
  • state: String? - State or province
  • country: String? - Country name
  • postalCode: String? - Postal or zip code
  • countryCode: String? - Country code (ISO format)
  • type: String? - The type or label for the address (e.g., home, work, other)
  • emoji: String? - An emoji icon associated with this address
  • contact: Contact? - Reference to the parent contact that owns this address

Usage Example

// Create an address
let address = ContactAddress(
    contactId: "contact-123",
    address1: "123 Main Street",
    address2: "Apt 4B",
    city: "San Francisco",
    county: nil,
    state: "CA",
    country: "United States",
    postalCode: "94105",
    countryCode: "US",
    type: "home",
    emoji: "🏠"
)

// Add to a contact
contact.addresses.append(address)

// Access from a contact
if let firstAddress = contact.addresses.first {
    print("Address: \(firstAddress.display())")
}