SHARE
TWEET

Untitled

a guest Jun 20th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Event{
  2.   var name:String = "";
  3.   var attributes:[String:Any] = [:];
  4.   var lineItems:[LineItem] = [];
  5. }
  6.  
  7. class LineItem {
  8.   var itemName:String = "";
  9.   var details:[String:Any] = [:];
  10. }
  11.      
  12. var test = Event()
  13.     test.name = "jogi"
  14.     var dictionary = Dictionary<String,Any>();
  15.     dictionary.updateValue("shoes", forKey: "item")
  16.     dictionary.updateValue(345, forKey: "amount")
  17.     test.attributes = dictionary
  18.  
  19.  
  20.     let json = JSON(test)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top