{"action":"closed","issue":{"url":"https://api.github.com/repos/hkellaway/Gloss/issues/125","repository_url":"https://api.github.com/repos/hkellaway/Gloss","labels_url":"https://api.github.com/repos/hkellaway/Gloss/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/hkellaway/Gloss/issues/125/comments","events_url":"https://api.github.com/repos/hkellaway/Gloss/issues/125/events","html_url":"https://github.com/hkellaway/Gloss/issues/125","id":136424675,"number":125,"title":"Simple Array","user":{"login":"valeIT","id":2276140,"avatar_url":"https://avatars.githubusercontent.com/u/2276140?v=3","gravatar_id":"","url":"https://api.github.com/users/valeIT","html_url":"https://github.com/valeIT","followers_url":"https://api.github.com/users/valeIT/followers","following_url":"https://api.github.com/users/valeIT/following{/other_user}","gists_url":"https://api.github.com/users/valeIT/gists{/gist_id}","starred_url":"https://api.github.com/users/valeIT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valeIT/subscriptions","organizations_url":"https://api.github.com/users/valeIT/orgs","repos_url":"https://api.github.com/users/valeIT/repos","events_url":"https://api.github.com/users/valeIT/events{/privacy}","received_events_url":"https://api.github.com/users/valeIT/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hkellaway/Gloss/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-25T15:42:09Z","updated_at":"2016-02-26T08:39:18Z","closed_at":"2016-02-26T08:39:18Z","body":"JSON:\r\n\r\n`[\r\n{\r\n\t\"nome\" : \"1\"\r\n},\r\n{\r\n\t\"nome\" : \"2\"\r\n},\r\n{\r\n\t\"nome\" : \"3\"\r\n}\r\n]`\r\n\r\n\r\nObject: [Using Realm]\r\n\r\n```\r\nclass Object: Object, Decodable {\r\n  dynamic var nome: String = \"\"\r\n  public convenience init?(json: JSON) {\r\n    guard let nome: String = \"nome\" <~~ json\r\n      else { return nil }\r\n    self.init()\r\n    self.nome = nome\r\n  }\r\n}\r\n```\r\n\r\nParsing from a file:\r\n\r\n```\r\nif fileManager.fileExistsAtPath(fullPath), let data = fileManager.contentsAtPath(fullPath) {\r\n          if let array: [AnyObject] = try NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers)  as? [AnyObject] {\r\n            guard let obj = [Object].fromJSONArray(array) else { //error here\r\n              return []\r\n            }\r\n         return obj\r\n\r\n```\r\n\r\n"}}