title: Return JSON on output Swift
body: <p>My Swift code output this:</p>
  
  <pre><code>{
  date = "2016-08-25 20:46:35 +0000";
  observation = "";
  products =     (
              {
          name = cafe;
          quantity = 1;
      },
              {
          name = cappuccino;
          quantity = 1;
      }
  );
  room = Platinium;
  }
  </code></pre>
  
  <p>But I need this JSON</p>
  
  <pre><code>{
  "date": "2016-08-25 20:46:35 +0000",
  "observation": "",
  "products": [{
      "name": "cafe",
      "quantity": 1
  }, {
      "name": "cappuccino",
      "quantity": 1
  }],
  "room": "Platinium"
  }
  </code></pre>
  
  <p>My classes is (Products and Order):</p>
  
  <pre><code> class Products  { 
      var name: String = ""
      var quantity: Int = 0
  
      init(name: String, quantity: Int) {
        self.name = name
      self.quantity = quantity
      }
   }
   class Order{
     var room: String = ""
     var products: Array&lt;Products&gt; = []
     var observations: String = ""
     var date: NSDate! = nil
     init(room: String, products:Array&lt;Products&gt;, observations: String, date: NSDate){
         self.room = room
         self.products = products
         self.observations = observations
         self.date = date
      }
   }
  </code></pre>
  
  <p>And this Swift 2 code to transform in json.. After I'm using a try/catch to transform in json with NSJSONSerialization </p>
  
  <pre><code>let para:NSMutableDictionary = NSMutableDictionary()
  let prodArray:NSMutableArray = NSMutableArray()
  
  
              para.setValue(String(receivedString), forKey: "room")
              para.setValue(observationString, forKey: "observation")
              para.setValue(stringDate, forKey: "date")
  
              for product in products{
                  let prod: NSMutableDictionary = NSMutableDictionary()
                  prod.setValue(product.name, forKey: "name")
                  prod.setValue(product.quantity, forKey: "quantity")
                  prodArray.addObject(prod)
              }
              para.setObject(prodArray, forKey: "products")
  </code></pre>
  
  <p>Someone help me? Thank you very much!!</p>