To test whether the dictionary contains any key-value pairs at all, we can use the isEmpty property. This property will return false if the dictionary contains one or more key-value pairs and true if it is empty. The following example shows how to use this property to determine whether our dictionary contains any key-value pairs:
let countries = ["US":"United States", "IN":"India","UK":"United Kingdom"] var empty = countries.isEmpty
In the preceding code, the isEmpty property returned false as there are three key-value pairs in the countries dictionary.