searchElement(forProperty:label:key:value:comparison:)
Returns a search element object that specifies a query for records of this type.
Declaration
class func searchElement(forProperty property: String!, label: String!, key: String!, value: Any!, comparison: ABSearchComparison) -> ABSearchElement!Parameters
- property:
The name of the property to search on, such as
kABAddressPropertyorkABLastNameProperty. This name cannot benil. For a full list of the properties, see Default Record Properties and Default Person Properties. - label:
The label name for a multivalue list, such as
kABAddressHomeLabel,kABPhoneWorkLabel, or a user-specified label, such asSummer Home. If the specified property does not have multiple values, passnil. If the specified property does have multiple values, passnilto search all the values. For a full list of label names, see Default Multivalue List Labels and Generic Multivalue List Labels. - key:
The key name for a dictionary, such as
kABAddressCityKeyorkABAddressStreetKey. If the specified property is not a dictionary, passnil. If the specified property is a dictionary, passnilto search all keys. For a full list of key names, see Address Keys. - value:
What you’re searching for. If
nil, then the only supported value forcomparisoniskABEqualorkABNotEqual. - comparison:
The type of comparison to perform, such as
kABEqualorkABPrefixMatchCaseInsensitive.