JSONEncoder How to Convert an object to JSON with Swift There could be a few reasons why you would want to convert a swift object to JSON. In this tutorial we will take a look at how we can convert a swift object to a JSON string and how to convert the JSON string to a swift object. First, let&