title: Unable to show JSON response data in out of serviceCall in Swift
body: <p>I have created Model for Json response add adding like below</p>
  <p><strong>and JSON ServiceCall like below</strong>: here i am getting JSON response and add values to label..</p>
  <pre><code>var orderDB = PlacedOrderDataModel(dictionary: NSDictionary()) 
  
  override func viewDidLoad() {
  super.viewDidLoad()
  
  orderDB = PlacedOrderDataModel(dictionary: NSDictionary()) // previous
  serviceCall()
  }
  
  func serviceCall(){
  var header = [&quot;Content-Type&quot;:&quot;application/json&quot;,
               &quot;X-localization&quot;: &quot;\(langType)&quot;]
  let url = getUrl(of: .getOrderData)+orderId
  
  APIReqeustManager.sharedInstance.getServiceCall(param: nil, vc: self, url: url, header: header) {(responseData) in
  
         self.orderDB = PlacedOrderDataModel(dictionary: responseData.dict as NSDictionary? ?? NSDictionary())
         let order = self.orderDB?.result?.order
         self.lblSubtotal.text = &quot;$\(order?.subtotal ?? &quot;&quot;)&quot;
         self.lblTotalDiscnt.text = &quot;$\(order?.total_discount ?? &quot;&quot;)&quot;
         self.totalPaybaleAmount.text = &quot;$\(order?.order_total ?? &quot;&quot;)&quot;
         self.tableView.reloadData()
  }
  }
  </code></pre>
  <p>but i need to add JSON data in out of serviceCall.. <strong>means here right below.. all the values i am getting nil</strong>.. but the same values i am getting in serviceCall()</p>
  <pre><code>extension FinalPlaceOrderVC: SessionDataSource, SessionDelegate, SessionAppearance{
  
  
   var customer: Customer? {
      print(&quot;testing \(self.orderDB?.result?.order?.shipping_email ?? &quot;&quot;)&quot;)
  
      var newCustomer: Customer? {
          let data = orderDB?.result?.order
          let emailAddress = try? EmailAddress(emailAddressString: data?.shipping_email ?? &quot;&quot;)
          let phoneNumber = try? PhoneNumber(isdNumber: &quot;956&quot;, phoneNumber: data?.shipping_phone ?? &quot;&quot;)
          let names = &quot;test tap&quot;
          return try? Customer(emailAddress: emailAddress, phoneNumber: phoneNumber, firstName: data?.shipping_fname ?? &quot;&quot;, middleName: nil, lastName: data?.shipping_lname ?? &quot;&quot;)
      }
      return newCustomer
   }
   var amount: Decimal {
      let order = self.orderDB?.result?.order
      let amount = Decimal(string: order?.order_total) ?? 0
      
      return amount
  }
  }
  </code></pre>
  <p>how to add JSON data here.. please do help</p>