Swift: checking if a String is valid JSON

Swift: checking if a String is valid JSON

Swift

I’ve been developing an application that produces a JSON string for use online. Pretty simple, but I want to make sure the JSON is valid (since a user can edit the JSON by hand if they want to before using the JSON string). How can you quickly validate your JSON?

Pretty easy.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.