{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments/39001776","id":39001776,"diff_hunk":"@@ -42,4 +49,60 @@ - (ASLayout *)measureWithSizeRange:(ASSizeRange)constrainedSize\n   return [ASLayout layoutWithLayoutableObject:self size:constrainedSize.min];\n }\n \n+- (ASLayoutSpec *)finalLayoutableWithParent:(ASLayoutSpec *)parentSpec;\n+{\n+  return nil;\n+}\n+\n+- (void)setChild:(id<ASLayoutable>)child;\n+{\n+  [self setChild:child forIdentifier:kDefaultChildKey];\n+}\n+\n+- (id<ASLayoutable>)layoutableToAddFromLayoutable:(id<ASLayoutable>)child\n+{\n+  ASLayoutOptions *layoutOptions = [child layoutOptions];\n+  \n+  id<ASLayoutable> finalLayoutable = [child finalLayoutableWithParent:self];\n+  if (finalLayoutable) {\n+    [layoutOptions copyIntoOptions:finalLayoutable.layoutOptions];\n+    return finalLayoutable;\n+  }\n+  return child;\n+}\n+\n+- (void)setChild:(id<ASLayoutable>)child forIdentifier:(NSString *)identifier\n+{\n+  ASDisplayNodeAssert(self.isMutable, @\"Cannot set properties when layout spec is not mutable\");\n+  self.layoutChildren[identifier] = [self layoutableToAddFromLayoutable:child];;\n+}\n+\n+- (void)setChildren:(NSArray *)children\n+{\n+  ASDisplayNodeAssert(self.isMutable, @\"Cannot set properties when layout spec is not mutable\");\n+  \n+  NSMutableArray *finalChildren = [NSMutableArray arrayWithCapacity:children.count];\n+  for (id<ASLayoutable> child in children) {\n+    [finalChildren addObject:[self layoutableToAddFromLayoutable:child]];","path":"AsyncDisplayKit/Layout/ASLayoutSpec.mm","position":75,"original_position":75,"commit_id":"fc9d589cf9da5778e1202272a2e25a76cac49622","original_commit_id":"fc9d589cf9da5778e1202272a2e25a76cac49622","user":{"login":"appleguy","id":565251,"avatar_url":"https://avatars.githubusercontent.com/u/565251?v=3","gravatar_id":"","url":"https://api.github.com/users/appleguy","html_url":"https://github.com/appleguy","followers_url":"https://api.github.com/users/appleguy/followers","following_url":"https://api.github.com/users/appleguy/following{/other_user}","gists_url":"https://api.github.com/users/appleguy/gists{/gist_id}","starred_url":"https://api.github.com/users/appleguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appleguy/subscriptions","organizations_url":"https://api.github.com/users/appleguy/orgs","repos_url":"https://api.github.com/users/appleguy/repos","events_url":"https://api.github.com/users/appleguy/events{/privacy}","received_events_url":"https://api.github.com/users/appleguy/received_events","type":"User","site_admin":false},"body":"OK, now I see that is just the primary mechanism to call finalLayoutable.  I think we could get rid of it completely, and just call finalLayoutable in-place, if we did not need to do the options merging.","created_at":"2015-09-09T02:20:35Z","updated_at":"2015-09-09T02:20:35Z","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/644#discussion_r39001776","pull_request_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/644","_links":{"self":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments/39001776"},"html":{"href":"https://github.com/facebook/AsyncDisplayKit/pull/644#discussion_r39001776"},"pull_request":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/644"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/644","id":44457833,"html_url":"https://github.com/facebook/AsyncDisplayKit/pull/644","diff_url":"https://github.com/facebook/AsyncDisplayKit/pull/644.diff","patch_url":"https://github.com/facebook/AsyncDisplayKit/pull/644.patch","issue_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/644","number":644,"state":"open","locked":false,"title":"Added ASLayoutOptions class to store all options for ASLayoutSpecs","user":{"login":"rcancro","id":285809,"avatar_url":"https://avatars.githubusercontent.com/u/285809?v=3","gravatar_id":"","url":"https://api.github.com/users/rcancro","html_url":"https://github.com/rcancro","followers_url":"https://api.github.com/users/rcancro/followers","following_url":"https://api.github.com/users/rcancro/following{/other_user}","gists_url":"https://api.github.com/users/rcancro/gists{/gist_id}","starred_url":"https://api.github.com/users/rcancro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcancro/subscriptions","organizations_url":"https://api.github.com/users/rcancro/orgs","repos_url":"https://api.github.com/users/rcancro/repos","events_url":"https://api.github.com/users/rcancro/events{/privacy}","received_events_url":"https://api.github.com/users/rcancro/received_events","type":"User","site_admin":false},"body":"`ASLayoutable` is now based on the protocol `ASLayoutablePrivate`. The private protocol contains both the `finalLayoutable` method as well as a `ASLayoutOptions` class.\r\n\r\nThe family of layoutable protocols (`ASStackLayoutable`, `ASBaselineLayoutable`, etc) still exist, but instead of being based on `ASLayoutable`, `ASLayoutable` implements all of the other layoutable protocols.\r\n\r\nSince both `ASDisplayNode` and `ASLayoutSpec` conform to `ASLayoutable` they both contain an `ASLayoutOptions` member. There is a private file, `ASLayoutOptionsPrivate.h/.m`, that implements the private protocol for these two classes. Now that `ASLayoutable` implements the layoutable protocols, `ASDisplayNode` and `ASLayoutSpec` also implement them via forwards to the internal `ASLayoutOptions`. \r\n\r\nAnother change is that `ASLayoutSpec` now holds all children for all subclasses. This allowed for the `finalLayoutable` method to only be called in one place throughout the app.\r\n\r\nOne question I have is whether we should move the baseline alignment back into ASStackLayoutSpec instead of it being its own layout spec. It seems strange to live off on its own to me.","created_at":"2015-09-08T17:08:21Z","updated_at":"2015-09-09T02:20:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1b5fba2f666ce038fe09d67b5a5f05ea158031f8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/644/commits","review_comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/644/comments","review_comment_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/644/comments","statuses_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/statuses/fc9d589cf9da5778e1202272a2e25a76cac49622","head":{"label":"rcancro:layoutOptions","ref":"layoutOptions","sha":"fc9d589cf9da5778e1202272a2e25a76cac49622","user":{"login":"rcancro","id":285809,"avatar_url":"https://avatars.githubusercontent.com/u/285809?v=3","gravatar_id":"","url":"https://api.github.com/users/rcancro","html_url":"https://github.com/rcancro","followers_url":"https://api.github.com/users/rcancro/followers","following_url":"https://api.github.com/users/rcancro/following{/other_user}","gists_url":"https://api.github.com/users/rcancro/gists{/gist_id}","starred_url":"https://api.github.com/users/rcancro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcancro/subscriptions","organizations_url":"https://api.github.com/users/rcancro/orgs","repos_url":"https://api.github.com/users/rcancro/repos","events_url":"https://api.github.com/users/rcancro/events{/privacy}","received_events_url":"https://api.github.com/users/rcancro/received_events","type":"User","site_admin":false},"repo":{"id":39976815,"name":"AsyncDisplayKit","full_name":"rcancro/AsyncDisplayKit","owner":{"login":"rcancro","id":285809,"avatar_url":"https://avatars.githubusercontent.com/u/285809?v=3","gravatar_id":"","url":"https://api.github.com/users/rcancro","html_url":"https://github.com/rcancro","followers_url":"https://api.github.com/users/rcancro/followers","following_url":"https://api.github.com/users/rcancro/following{/other_user}","gists_url":"https://api.github.com/users/rcancro/gists{/gist_id}","starred_url":"https://api.github.com/users/rcancro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcancro/subscriptions","organizations_url":"https://api.github.com/users/rcancro/orgs","repos_url":"https://api.github.com/users/rcancro/repos","events_url":"https://api.github.com/users/rcancro/events{/privacy}","received_events_url":"https://api.github.com/users/rcancro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rcancro/AsyncDisplayKit","description":"Smooth asynchronous user interfaces for iOS apps.","fork":true,"url":"https://api.github.com/repos/rcancro/AsyncDisplayKit","forks_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/forks","keys_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/teams","hooks_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/hooks","issue_events_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/issues/events{/number}","events_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/events","assignees_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/assignees{/user}","branches_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/branches{/branch}","tags_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/tags","blobs_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/statuses/{sha}","languages_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/languages","stargazers_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/stargazers","contributors_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/contributors","subscribers_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/subscribers","subscription_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/subscription","commits_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/contents/{+path}","compare_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/merges","archive_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/downloads","issues_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/issues{/number}","pulls_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/pulls{/number}","milestones_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/milestones{/number}","notifications_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/labels{/name}","releases_url":"https://api.github.com/repos/rcancro/AsyncDisplayKit/releases{/id}","created_at":"2015-07-30T23:28:33Z","updated_at":"2015-07-30T23:28:35Z","pushed_at":"2015-09-08T16:53:27Z","git_url":"git://github.com/rcancro/AsyncDisplayKit.git","ssh_url":"git@github.com:rcancro/AsyncDisplayKit.git","clone_url":"https://github.com/rcancro/AsyncDisplayKit.git","svn_url":"https://github.com/rcancro/AsyncDisplayKit","homepage":"http://asyncdisplaykit.org","size":2593,"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":"052f4c44f179c4c093e55dc211a62533594bdcb2","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-09-08T20:37:48Z","pushed_at":"2015-09-08T19:44:46Z","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":6025,"stargazers_count":5610,"watchers_count":5610,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":731,"mirror_url":null,"open_issues_count":99,"forks":731,"open_issues":99,"watchers":5610,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/644"},"html":{"href":"https://github.com/facebook/AsyncDisplayKit/pull/644"},"issue":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/644"},"comments":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/644/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/644/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/644/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/AsyncDisplayKit/statuses/fc9d589cf9da5778e1202272a2e25a76cac49622"}}}}