{"action":"created","comment":{"url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/pulls/comments/47020975","id":47020975,"diff_hunk":"@@ -129,4 +129,39 @@ - (IBAction)shareButtonTouchUpInside:(id)sender {\n     }\n }\n \n+- (void)setPreferredMaxLayoutWidthForLabels {\n+    CGFloat width = CGRectGetWidth([UIScreen mainScreen].bounds);\n+    NSLog(@\"setPreferredMaxLayoutWidthForLabels width %f\", width);\n+    self.reportbackItemCaptionLabel.preferredMaxLayoutWidth = width - 16;\n+    self.reportbackItemQuantityLabel.preferredMaxLayoutWidth = width / 3;\n+    self.userCountryNameLabel.preferredMaxLayoutWidth = 100;\n+}\n+\n+- (CGSize)preferredLayoutSizeFittingSize:(CGSize)targetSize {\n+    CGRect originalFrame = self.frame;\n+\n+    // step1: set the detailView.frame to use our target width\n+    self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, targetSize.width, targetSize.height);\n+    NSLog(@\"targetSize.width %f\", targetSize.width);\n+\n+    // step2: layout the cell\n+    [self setNeedsLayout];\n+    [self layoutIfNeeded];\n+// Setting this to the desired width always results in the extra caption vertical padding. If we set it to just bounds.size.width like the SO thread suggests, we get vertical padding for first few rows but usually we eventually get the correct padding too.\n+//    self.reportbackItemCaptionLabel.preferredMaxLayoutWidth = targetSize.width - 16;\n+    self.reportbackItemCaptionLabel.preferredMaxLayoutWidth = self.reportbackItemCaptionLabel.bounds.size.width;\n+    NSLog(@\"reportbackItemCaptionLabel.preferredMaxLayoutWidth %f: \", self.reportbackItemCaptionLabel.preferredMaxLayoutWidth);","path":"Lets Do This/Views/Reportback/LDTReportbackItemDetailView.m","position":35,"original_position":35,"commit_id":"4984e2b9d548fb30ebcdeadae1dc794fd6bc3791","original_commit_id":"4984e2b9d548fb30ebcdeadae1dc794fd6bc3791","user":{"login":"aaronschachter","id":1236811,"avatar_url":"https://avatars.githubusercontent.com/u/1236811?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronschachter","html_url":"https://github.com/aaronschachter","followers_url":"https://api.github.com/users/aaronschachter/followers","following_url":"https://api.github.com/users/aaronschachter/following{/other_user}","gists_url":"https://api.github.com/users/aaronschachter/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronschachter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronschachter/subscriptions","organizations_url":"https://api.github.com/users/aaronschachter/orgs","repos_url":"https://api.github.com/users/aaronschachter/repos","events_url":"https://api.github.com/users/aaronschachter/events{/privacy}","received_events_url":"https://api.github.com/users/aaronschachter/received_events","type":"User","site_admin":false},"body":"Testing on a 6S - This keeps returning 279 which seems to cause the large vertical spacing.","created_at":"2015-12-08T22:04:09Z","updated_at":"2015-12-08T22:04:09Z","html_url":"https://github.com/DoSomething/LetsDoThis-iOS/pull/694#discussion_r47020975","pull_request_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/pulls/694","_links":{"self":{"href":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/pulls/comments/47020975"},"html":{"href":"https://github.com/DoSomething/LetsDoThis-iOS/pull/694#discussion_r47020975"},"pull_request":{"href":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/pulls/694"}}},"pull_request":{"url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/pulls/694","id":52936341,"html_url":"https://github.com/DoSomething/LetsDoThis-iOS/pull/694","diff_url":"https://github.com/DoSomething/LetsDoThis-iOS/pull/694.diff","patch_url":"https://github.com/DoSomething/LetsDoThis-iOS/pull/694.patch","issue_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/issues/694","number":694,"state":"open","locked":false,"title":"Opened for review - preferredLayoutSizeFittingSize","user":{"login":"aaronschachter","id":1236811,"avatar_url":"https://avatars.githubusercontent.com/u/1236811?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronschachter","html_url":"https://github.com/aaronschachter","followers_url":"https://api.github.com/users/aaronschachter/followers","following_url":"https://api.github.com/users/aaronschachter/following{/other_user}","gists_url":"https://api.github.com/users/aaronschachter/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronschachter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronschachter/subscriptions","organizations_url":"https://api.github.com/users/aaronschachter/orgs","repos_url":"https://api.github.com/users/aaronschachter/repos","events_url":"https://api.github.com/users/aaronschachter/events{/privacy}","received_events_url":"https://api.github.com/users/aaronschachter/received_events","type":"User","site_admin":false},"body":"Follows the steps in this [SO answer](http://stackoverflow.com/a/26349770/1470725) in an attempt to resolve #676. The author suggests `preferredLayoutAttributesFittingAttributes` is a \"red herring\" -- only be to used when you set the `estimatedItemSize`, which the author suggests is buggy:\r\n> In practice, I haven't seen any examples that have gotten this to work with multi-line labels. I think this is partly because the self-sizing cell mechanism is still buggy \r\n\r\nWhat's a teeny bit maddening is that when I first load Barbie Bash (building to prod), everything works great:\r\n\r\n![screen shot 2015-12-07 at 8 07 14 pm](https://cloud.githubusercontent.com/assets/1236811/11647559/33958d66-9d1e-11e5-9d5c-9528dd5fd091.png)\r\n\r\nWhen I view the Barbie Bash `LDTCampaignDetailViewController` a second time, I get the extra vertical padding on the Caption label, as I'm seeing in the other branches (#687 and #688)\r\n\r\n![screen shot 2015-12-07 at 8 00 43 pm](https://cloud.githubusercontent.com/assets/1236811/11647463/4e5dc844-9d1d-11e5-8725-0fbbb09fdf4a.png)","created_at":"2015-12-08T04:08:58Z","updated_at":"2015-12-08T22:04:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d7dfbf15ca936e69de86c71bbb72675ebd09143","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/pulls/694/commits","review_comments_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/pulls/694/comments","review_comment_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/issues/694/comments","statuses_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/statuses/4984e2b9d548fb30ebcdeadae1dc794fd6bc3791","head":{"label":"DoSomething:preferredLayoutSizeFittingSize","ref":"preferredLayoutSizeFittingSize","sha":"4984e2b9d548fb30ebcdeadae1dc794fd6bc3791","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":33381932,"name":"LetsDoThis-iOS","full_name":"DoSomething/LetsDoThis-iOS","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/LetsDoThis-iOS","description":"The DoSomething.org iOS mobile app.","fork":false,"url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS","forks_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/forks","keys_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/teams","hooks_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/events","assignees_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/tags","blobs_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/languages","stargazers_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/subscription","commits_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/merges","archive_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/downloads","issues_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/releases{/id}","created_at":"2015-04-03T20:42:47Z","updated_at":"2015-11-19T01:11:30Z","pushed_at":"2015-12-08T21:00:05Z","git_url":"git://github.com/DoSomething/LetsDoThis-iOS.git","ssh_url":"git@github.com:DoSomething/LetsDoThis-iOS.git","clone_url":"https://github.com/DoSomething/LetsDoThis-iOS.git","svn_url":"https://github.com/DoSomething/LetsDoThis-iOS","homepage":null,"size":13830,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":26,"forks":0,"open_issues":26,"watchers":0,"default_branch":"develop"}},"base":{"label":"DoSomething:develop","ref":"develop","sha":"4eb513b8f22b0af3b5665b4246a824aa25d5b919","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":33381932,"name":"LetsDoThis-iOS","full_name":"DoSomething/LetsDoThis-iOS","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/LetsDoThis-iOS","description":"The DoSomething.org iOS mobile app.","fork":false,"url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS","forks_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/forks","keys_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/teams","hooks_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/events","assignees_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/tags","blobs_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/languages","stargazers_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/subscription","commits_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/merges","archive_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/downloads","issues_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/releases{/id}","created_at":"2015-04-03T20:42:47Z","updated_at":"2015-11-19T01:11:30Z","pushed_at":"2015-12-08T21:00:05Z","git_url":"git://github.com/DoSomething/LetsDoThis-iOS.git","ssh_url":"git@github.com:DoSomething/LetsDoThis-iOS.git","clone_url":"https://github.com/DoSomething/LetsDoThis-iOS.git","svn_url":"https://github.com/DoSomething/LetsDoThis-iOS","homepage":null,"size":13830,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":26,"forks":0,"open_issues":26,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/pulls/694"},"html":{"href":"https://github.com/DoSomething/LetsDoThis-iOS/pull/694"},"issue":{"href":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/issues/694"},"comments":{"href":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/issues/694/comments"},"review_comments":{"href":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/pulls/694/comments"},"review_comment":{"href":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/pulls/694/commits"},"statuses":{"href":"https://api.github.com/repos/DoSomething/LetsDoThis-iOS/statuses/4984e2b9d548fb30ebcdeadae1dc794fd6bc3791"}}}}