{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments/36049600","id":36049600,"diff_hunk":"@@ -506,7 +506,18 @@ typedef CALayer *(^ASDisplayNodeLayerBlock)();\n @interface ASDisplayNode (UIViewBridge)\n \n - (void)setNeedsDisplay;    // Marks the view as needing display. Convenience for use whether view is created or not, or from a background thread.\n-- (void)setNeedsLayout;     // Marks the view as needing layout.  Convenience for use whether view is created or not, or from a background thread.\n+\n+/**\n+ * Marks the view as needing layout. Convenience for use whether view is created or not, or from a background thread.","path":"AsyncDisplayKit/ASDisplayNode.h","position":null,"original_position":7,"commit_id":"0acfea234f09ca092bb408226524a731c0f15b52","original_commit_id":"56768a837ab9e3ebee08345822f8bf17fab429e9","user":{"login":"nguyenhuy","id":587874,"avatar_url":"https://avatars.githubusercontent.com/u/587874?v=3","gravatar_id":"","url":"https://api.github.com/users/nguyenhuy","html_url":"https://github.com/nguyenhuy","followers_url":"https://api.github.com/users/nguyenhuy/followers","following_url":"https://api.github.com/users/nguyenhuy/following{/other_user}","gists_url":"https://api.github.com/users/nguyenhuy/gists{/gist_id}","starred_url":"https://api.github.com/users/nguyenhuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nguyenhuy/subscriptions","organizations_url":"https://api.github.com/users/nguyenhuy/orgs","repos_url":"https://api.github.com/users/nguyenhuy/repos","events_url":"https://api.github.com/users/nguyenhuy/events{/privacy}","received_events_url":"https://api.github.com/users/nguyenhuy/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2015-08-02T23:30:54Z","updated_at":"2015-08-02T23:30:54Z","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/594#discussion_r36049600","pull_request_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/594","_links":{"self":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments/36049600"},"html":{"href":"https://github.com/facebook/AsyncDisplayKit/pull/594#discussion_r36049600"},"pull_request":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/594"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/594","id":41418429,"html_url":"https://github.com/facebook/AsyncDisplayKit/pull/594","diff_url":"https://github.com/facebook/AsyncDisplayKit/pull/594.diff","patch_url":"https://github.com/facebook/AsyncDisplayKit/pull/594.patch","issue_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/594","number":594,"state":"open","locked":false,"title":"Support internal relayout","user":{"login":"nguyenhuy","id":587874,"avatar_url":"https://avatars.githubusercontent.com/u/587874?v=3","gravatar_id":"","url":"https://api.github.com/users/nguyenhuy","html_url":"https://github.com/nguyenhuy","followers_url":"https://api.github.com/users/nguyenhuy/followers","following_url":"https://api.github.com/users/nguyenhuy/following{/other_user}","gists_url":"https://api.github.com/users/nguyenhuy/gists{/gist_id}","starred_url":"https://api.github.com/users/nguyenhuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nguyenhuy/subscriptions","organizations_url":"https://api.github.com/users/nguyenhuy/orgs","repos_url":"https://api.github.com/users/nguyenhuy/repos","events_url":"https://api.github.com/users/nguyenhuy/events{/privacy}","received_events_url":"https://api.github.com/users/nguyenhuy/received_events","type":"User","site_admin":false},"body":"This PR is the first in a series of PRs that aim to support relayout. Relayouts can be categorized into 2 types: external and internal.\r\n- External relayouts are caused by a new constrained size applied to the root node (like orientation change). This can be easily supported by calling -measure on every nodes.\r\n- Internal relayouts are not caused by a different constrained size used on the root node. Instead, they are caused by internal layout changes, like subnodes re-arrangement and/or subnodes' size change.\r\n\r\nInternal relayouts are triggers by calling -setNeedsLayout. The method does following things:\r\n- Invalidates calculated layout of the display node.\r\n- If the node is not a root node, -setNeedsLayout will be recursively called on higher-level nodes, until the root node gets the message. This will cause a certain branch in the node tree to be marked as \"dirty\".\r\n- If the node is the root one, a full measurement pass is executed on the current thread, using the old constrained size. Dirty nodes will then re-measure their layout. [Depends on each scenario](https://goo.gl/photos/N8HsgSsvYf9DVzKL7), clean nodes might reuse their calculated layout.\r\n\r\nA layout pass will then be trigger automatically. But depends on the new layout, 2 scenarios will happen:\r\n- If the root node has the same size as before, everything should be fine. A good example is the way image and text nodes in KittenNode are swapped (see -toggleNodesSwap).\r\n- If the root node has a different size and it is attached to a container view (table or collection view, for example), the container view must be notified to redraw. In case of table or collection view, calling beginUpdates and endUpdates is enough (see -toggleImageEnlargement in Kittens example).\r\n","created_at":"2015-08-02T14:11:35Z","updated_at":"2015-08-02T23:30:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"643184c3de19d85ea6729fa84482920a23875786","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/594/commits","review_comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/594/comments","review_comment_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/594/comments","statuses_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/statuses/0acfea234f09ca092bb408226524a731c0f15b52","head":{"label":"nguyenhuy:relayout_same_constrained_size","ref":"relayout_same_constrained_size","sha":"0acfea234f09ca092bb408226524a731c0f15b52","user":{"login":"nguyenhuy","id":587874,"avatar_url":"https://avatars.githubusercontent.com/u/587874?v=3","gravatar_id":"","url":"https://api.github.com/users/nguyenhuy","html_url":"https://github.com/nguyenhuy","followers_url":"https://api.github.com/users/nguyenhuy/followers","following_url":"https://api.github.com/users/nguyenhuy/following{/other_user}","gists_url":"https://api.github.com/users/nguyenhuy/gists{/gist_id}","starred_url":"https://api.github.com/users/nguyenhuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nguyenhuy/subscriptions","organizations_url":"https://api.github.com/users/nguyenhuy/orgs","repos_url":"https://api.github.com/users/nguyenhuy/repos","events_url":"https://api.github.com/users/nguyenhuy/events{/privacy}","received_events_url":"https://api.github.com/users/nguyenhuy/received_events","type":"User","site_admin":false},"repo":{"id":38862516,"name":"AsyncDisplayKit","full_name":"nguyenhuy/AsyncDisplayKit","owner":{"login":"nguyenhuy","id":587874,"avatar_url":"https://avatars.githubusercontent.com/u/587874?v=3","gravatar_id":"","url":"https://api.github.com/users/nguyenhuy","html_url":"https://github.com/nguyenhuy","followers_url":"https://api.github.com/users/nguyenhuy/followers","following_url":"https://api.github.com/users/nguyenhuy/following{/other_user}","gists_url":"https://api.github.com/users/nguyenhuy/gists{/gist_id}","starred_url":"https://api.github.com/users/nguyenhuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nguyenhuy/subscriptions","organizations_url":"https://api.github.com/users/nguyenhuy/orgs","repos_url":"https://api.github.com/users/nguyenhuy/repos","events_url":"https://api.github.com/users/nguyenhuy/events{/privacy}","received_events_url":"https://api.github.com/users/nguyenhuy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nguyenhuy/AsyncDisplayKit","description":"Smooth asynchronous user interfaces for iOS apps.","fork":true,"url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit","forks_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/forks","keys_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/teams","hooks_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/hooks","issue_events_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/issues/events{/number}","events_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/events","assignees_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/assignees{/user}","branches_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/branches{/branch}","tags_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/tags","blobs_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/statuses/{sha}","languages_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/languages","stargazers_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/stargazers","contributors_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/contributors","subscribers_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/subscribers","subscription_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/subscription","commits_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/contents/{+path}","compare_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/merges","archive_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/downloads","issues_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/issues{/number}","pulls_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/pulls{/number}","milestones_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/milestones{/number}","notifications_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/labels{/name}","releases_url":"https://api.github.com/repos/nguyenhuy/AsyncDisplayKit/releases{/id}","created_at":"2015-07-10T05:22:25Z","updated_at":"2015-07-10T05:22:27Z","pushed_at":"2015-08-02T23:30:19Z","git_url":"git://github.com/nguyenhuy/AsyncDisplayKit.git","ssh_url":"git@github.com:nguyenhuy/AsyncDisplayKit.git","clone_url":"https://github.com/nguyenhuy/AsyncDisplayKit.git","svn_url":"https://github.com/nguyenhuy/AsyncDisplayKit","homepage":"http://asyncdisplaykit.org","size":2274,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"16ed66c3a16813f9a0d9726766badc338e557e14","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":21265042,"name":"AsyncDisplayKit","full_name":"facebook/AsyncDisplayKit","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/AsyncDisplayKit","description":"Smooth asynchronous user interfaces for iOS apps.","fork":false,"url":"https://api.github.com/repos/facebook/AsyncDisplayKit","forks_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/forks","keys_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/teams","hooks_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/hooks","issue_events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/events","assignees_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/tags","blobs_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/languages","stargazers_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/stargazers","contributors_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/contributors","subscribers_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/subscribers","subscription_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/subscription","commits_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/merges","archive_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/downloads","issues_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/labels{/name}","releases_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/releases{/id}","created_at":"2014-06-27T05:29:02Z","updated_at":"2015-08-02T18:07:58Z","pushed_at":"2015-08-02T23:30:20Z","git_url":"git://github.com/facebook/AsyncDisplayKit.git","ssh_url":"git@github.com:facebook/AsyncDisplayKit.git","clone_url":"https://github.com/facebook/AsyncDisplayKit.git","svn_url":"https://github.com/facebook/AsyncDisplayKit","homepage":"http://asyncdisplaykit.org","size":5271,"stargazers_count":5393,"watchers_count":5393,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":680,"mirror_url":null,"open_issues_count":92,"forks":680,"open_issues":92,"watchers":5393,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/594"},"html":{"href":"https://github.com/facebook/AsyncDisplayKit/pull/594"},"issue":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/594"},"comments":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/594/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/594/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/594/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/statuses/0acfea234f09ca092bb408226524a731c0f15b52"}}}}