{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/981","repository_url":"https://api.github.com/repos/facebook/AsyncDisplayKit","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/981/labels{/name}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/981/comments","events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/981/events","html_url":"https://github.com/facebook/AsyncDisplayKit/issues/981","id":123701945,"number":981,"title":"What is a ASRelativeSizeRangeMake? Why is it useful?","user":{"login":"fatuhoku","id":430233,"avatar_url":"https://avatars.githubusercontent.com/u/430233?v=3","gravatar_id":"","url":"https://api.github.com/users/fatuhoku","html_url":"https://github.com/fatuhoku","followers_url":"https://api.github.com/users/fatuhoku/followers","following_url":"https://api.github.com/users/fatuhoku/following{/other_user}","gists_url":"https://api.github.com/users/fatuhoku/gists{/gist_id}","starred_url":"https://api.github.com/users/fatuhoku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatuhoku/subscriptions","organizations_url":"https://api.github.com/users/fatuhoku/orgs","repos_url":"https://api.github.com/users/fatuhoku/repos","events_url":"https://api.github.com/users/fatuhoku/events{/privacy}","received_events_url":"https://api.github.com/users/fatuhoku/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-23T18:09:42Z","updated_at":"2016-03-31T05:29:30Z","closed_at":"2016-03-31T05:29:30Z","body":"Can someone please explain what `RelativeSizeRange` is vs. `SizeRange`, and how you're supposed to translate between the two? I can't make sense of it just reading the source code. For instance, here's a snippet taken from `examples/SocialAppLayout`:\r\n\r\n\r\n```objc\r\n- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize {\r\n    \r\n    ASStackLayoutSpec *mainStack = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal spacing:6.0 justifyContent:ASStackLayoutJustifyContentStart alignItems:ASStackLayoutAlignItemsCenter children:@[_iconNode, _countNode]];\r\n    \r\n    // set sizeRange to make width fixed to 60\r\n    mainStack.sizeRange = ASRelativeSizeRangeMake(ASRelativeSizeMake(\r\n                                                                     ASRelativeDimensionMakeWithPoints(60.0),\r\n                                                                     ASRelativeDimensionMakeWithPoints(0.0)\r\n                                                                     ), ASRelativeSizeMake(\r\n                                                                                           ASRelativeDimensionMakeWithPoints(60.0),\r\n                                                                                           ASRelativeDimensionMakeWithPoints(40.0)\r\n                                                                                           ));\r\n    return [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[mainStack]];\r\n    \r\n}\r\n```\r\n\r\nWhat if I don't know what the maximum size is? What do I put in the upper bound for the sizeRange then?\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/comments/203758989","html_url":"https://github.com/facebook/AsyncDisplayKit/issues/981#issuecomment-203758989","issue_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/981","id":203758989,"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},"created_at":"2016-03-31T05:29:30Z","updated_at":"2016-03-31T05:29:30Z","body":"@fatuhoku sometimes you want to use CGFLOAT_MAX or the ...Unconstrained constant provided in ASDimension.\r\n\r\nFeel free to inquire about any specific layout you're aiming to build. Otherwise, it is difficult to give specific advice on the right approach. All of these things are in Great need of clear documentation, and we have many issues tracking very specific parts of that need, including simplification and examples around preferredFrameSize and sizeRange.\r\n\r\nSee: issue 73 and others in Ship."}}