Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement