{"action":"created","issue":{"url":"https://api.github.com/repos/Instagram/IGListKit/issues/290","repository_url":"https://api.github.com/repos/Instagram/IGListKit","labels_url":"https://api.github.com/repos/Instagram/IGListKit/issues/290/labels{/name}","comments_url":"https://api.github.com/repos/Instagram/IGListKit/issues/290/comments","events_url":"https://api.github.com/repos/Instagram/IGListKit/issues/290/events","html_url":"https://github.com/Instagram/IGListKit/issues/290","id":193728177,"number":290,"title":"[Question] Tile update/operation","user":{"login":"mobilinked","id":10665201,"avatar_url":"https://avatars.githubusercontent.com/u/10665201?v=3","gravatar_id":"","url":"https://api.github.com/users/mobilinked","html_url":"https://github.com/mobilinked","followers_url":"https://api.github.com/users/mobilinked/followers","following_url":"https://api.github.com/users/mobilinked/following{/other_user}","gists_url":"https://api.github.com/users/mobilinked/gists{/gist_id}","starred_url":"https://api.github.com/users/mobilinked/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobilinked/subscriptions","organizations_url":"https://api.github.com/users/mobilinked/orgs","repos_url":"https://api.github.com/users/mobilinked/repos","events_url":"https://api.github.com/users/mobilinked/events{/privacy}","received_events_url":"https://api.github.com/users/mobilinked/received_events","type":"User","site_admin":false},"labels":[{"id":438144356,"url":"https://api.github.com/repos/Instagram/IGListKit/labels/question","name":"question","color":"D10869","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-06T09:55:40Z","updated_at":"2016-12-19T17:02:10Z","closed_at":"2016-12-07T00:26:41Z","body":"I hope it is ok to ask this here. Otherwise, please feel free to delete this thread.\r\n\r\n### Purpose\r\n- I hope to create a GRID (multiple sections, and multiple cells in each section)\r\n- The model is something like: \r\n```\r\nfinal class SectionModel: IGListDiffable {\r\n    let id: String\r\n    let name: String\r\n    var cells: [CellModel]\r\n...\r\n}\r\n\r\nfinal class CellModel: IGListDiffable {\r\n    let id: String\r\n    var name: String\r\n...\r\n}\r\n```\r\n- And in the view controller, the adapter data source is to a variable\r\n```var data: [CellModel] = [...]```\r\n- And in the section control for cells controlling\r\n\r\n### Challenges to me\r\n- I tried to update cell content like: \r\n```\r\nself.data[0].cells[0].name = \"****\" \r\nadapter.performUpdates(animated: true)\r\n```\r\nThis does not work, as the model object is class object, the value been changed before compare the value by the adapter (adapter has no way to know if something changed) \r\n\r\n- Then tried: \r\n```\r\nself.data[0].cells[0].name = \"****\" \r\nadapter.reloadData() \r\n```\r\nThis works, but reload all sections (cells) \r\n\r\n- Then tried: \r\n```\r\nlet obj = self.data[0].cells[0]\r\nobj.name = \"****\" \r\nadapter.reloadObjects([obj])\r\n```\r\nThis works, but reload all the cells in the whole section\r\n\r\n### So the question#1\r\nIf as preceding not to recreate all the model objects (recreate self.data, just directly change the properties), what's the suitable way to update a specific cell related updated cell model object? \r\n\r\n### question#2\r\nDoes IGListKit support to move cell by gesture? If we have to write code to do it, how to update the model object after moving? \r\n\r\nThanks,\r\n"},"comment":{"url":"https://api.github.com/repos/Instagram/IGListKit/issues/comments/268018578","html_url":"https://github.com/Instagram/IGListKit/issues/290#issuecomment-268018578","issue_url":"https://api.github.com/repos/Instagram/IGListKit/issues/290","id":268018578,"user":{"login":"shuhrat10","id":62485,"avatar_url":"https://avatars.githubusercontent.com/u/62485?v=3","gravatar_id":"","url":"https://api.github.com/users/shuhrat10","html_url":"https://github.com/shuhrat10","followers_url":"https://api.github.com/users/shuhrat10/followers","following_url":"https://api.github.com/users/shuhrat10/following{/other_user}","gists_url":"https://api.github.com/users/shuhrat10/gists{/gist_id}","starred_url":"https://api.github.com/users/shuhrat10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shuhrat10/subscriptions","organizations_url":"https://api.github.com/users/shuhrat10/orgs","repos_url":"https://api.github.com/users/shuhrat10/repos","events_url":"https://api.github.com/users/shuhrat10/events{/privacy}","received_events_url":"https://api.github.com/users/shuhrat10/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T17:02:10Z","updated_at":"2016-12-19T17:02:10Z","body":"@rnystrom That will be awesome, I can't wait to see this functionality. "}}
{"actor":{"display_login":"shuhrat10"}}