khunshan khunshan - 1 year ago 307
Swift Question

Convert Swift Dictionary to String

For testing and debugging I am trying to put the content of Dictionary to a String. But have no clue hows it going to achieve. Is it possible? If yes, how.

Dictionary is fetched from web service so I have no idea the key values it have. I want to use the data in app.

In Objective C %@ was enough to store anything in NSString.

Answer Source

Just use the description property of Printable as


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download