In Swift, you can convert a struct into a dictionary by using the Mirror type, which provides a way to introspect the values of an instance of a struct or class. Here’s an example of how you can convert a struct into a dictionary: In this example, we create a Person struct with three properties: