Check if object is a dictionary

 Problem

I have an object and want to check if it's a Dictionary object.



 Recipe


// Initialize the dictionary

let dict = ["name":"John", "surname":"Doe"]

// Check if 'dict' is a Dictionary

if dict is Dictionary {
    print("Yes, it's a Dictionary")
}

				


 Playground