{"action":"created","issue":{"url":"https://api.github.com/repos/DenHeadless/DTTableViewManager/issues/33","repository_url":"https://api.github.com/repos/DenHeadless/DTTableViewManager","labels_url":"https://api.github.com/repos/DenHeadless/DTTableViewManager/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/DenHeadless/DTTableViewManager/issues/33/comments","events_url":"https://api.github.com/repos/DenHeadless/DTTableViewManager/issues/33/events","html_url":"https://github.com/DenHeadless/DTTableViewManager/issues/33","id":135439906,"number":33,"title":"When adding an item within whenSelected function, configureCell doesn't get called","user":{"login":"augmentedworks","id":5872585,"avatar_url":"https://avatars.githubusercontent.com/u/5872585?v=3","gravatar_id":"","url":"https://api.github.com/users/augmentedworks","html_url":"https://github.com/augmentedworks","followers_url":"https://api.github.com/users/augmentedworks/followers","following_url":"https://api.github.com/users/augmentedworks/following{/other_user}","gists_url":"https://api.github.com/users/augmentedworks/gists{/gist_id}","starred_url":"https://api.github.com/users/augmentedworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/augmentedworks/subscriptions","organizations_url":"https://api.github.com/users/augmentedworks/orgs","repos_url":"https://api.github.com/users/augmentedworks/repos","events_url":"https://api.github.com/users/augmentedworks/events{/privacy}","received_events_url":"https://api.github.com/users/augmentedworks/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-22T14:48:21Z","updated_at":"2016-02-23T14:07:37Z","closed_at":"2016-02-23T14:07:37Z","body":"Hello!\r\nIf you add a new item on your memoryStorage within a whenSelected function, configureCell for the new cell doesn't get called.\r\n\r\nFor example:\r\n\r\n`manager.registerCellClass(RightDetailTableViewCell.self) { [weak self] (cell, model, indexPath) -> Void in\r\n            let someObject = SomeObject()\r\n            try! manager.memoryStorage.addItem(someObject, toSection: 0)\r\n        }`\r\n\r\n`manager.configureCell(SomeCell.self) { (cell, model, indexPath) -> Void in\r\n            print(\"This doesn't get called\")\r\n        }`\r\n\r\nI discovered that calling performSelectorOnMainThread works, which is strange because what is inside the whenSelected function is already executed on the main thread.\r\n\r\n`manager.registerCellClass(RightDetailTableViewCell.self) { [weak self] (cell, model, indexPath) -> Void in\r\n            self?.performSelectorOnMainThread(\"addItem\", withObject: userInfo, waitUntilDone: true)\r\n        }`\r\n\r\n`func addItem() {\r\n            let someObject = SomeObject()\r\n            try! manager.memoryStorage.addItem(someObject, toSection: 0)\r\n}`\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/DenHeadless/DTTableViewManager/issues/comments/187712912","html_url":"https://github.com/DenHeadless/DTTableViewManager/issues/33#issuecomment-187712912","issue_url":"https://api.github.com/repos/DenHeadless/DTTableViewManager/issues/33","id":187712912,"user":{"login":"augmentedworks","id":5872585,"avatar_url":"https://avatars.githubusercontent.com/u/5872585?v=3","gravatar_id":"","url":"https://api.github.com/users/augmentedworks","html_url":"https://github.com/augmentedworks","followers_url":"https://api.github.com/users/augmentedworks/followers","following_url":"https://api.github.com/users/augmentedworks/following{/other_user}","gists_url":"https://api.github.com/users/augmentedworks/gists{/gist_id}","starred_url":"https://api.github.com/users/augmentedworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/augmentedworks/subscriptions","organizations_url":"https://api.github.com/users/augmentedworks/orgs","repos_url":"https://api.github.com/users/augmentedworks/repos","events_url":"https://api.github.com/users/augmentedworks/events{/privacy}","received_events_url":"https://api.github.com/users/augmentedworks/received_events","type":"User","site_admin":false},"created_at":"2016-02-23T14:07:37Z","updated_at":"2016-02-23T14:07:37Z","body":"Sorry Denis, I was working with an older version of the library.\r\nThe last one doesn't have the problem.\r\nThanks"}}