GitHub PullRequestReviewCommentEvent at 2014-07-28 21:15:30
Repository: MPGNotification
Actor: toblerpwn
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/MPGNotification/MPGNotification/pulls/comments/15491393","id":15491393,"diff_hunk":"@@ -183,15 +183,30 @@ - (void)layoutSubviews {\n     static const CGFloat kTitleLabelPaddingX = 8;\n     static const CGFloat kTitleLabelHeight = 20;\n     \n-    CGFloat textPaddingX = (self.iconImageView) ? CGRectGetMaxX(self.iconImageView.frame) + kTitleLabelPaddingX : kPaddingX;\n-    CGFloat textTrailingX = (self.firstButton) ? CGRectGetWidth(self.bounds) - CGRectGetMinX(self.firstButton.frame) + 9 : 20;\n+    CGFloat textPaddingX = (self.iconImage) ? CGRectGetMaxX(self.iconImageView.frame) + kTitleLabelPaddingX : kPaddingX+5;\n+    CGFloat textTrailingX = (self.firstButton) ? CGRectGetWidth(self.bounds) - CGRectGetMinX(self.firstButton.frame) + 9 : 10;\n     CGFloat textWidth = notificationWidth - (textPaddingX + textTrailingX);\n     \n     // expected subtitle calculations\n-    // TODO: this method is deprecated; update this (use Evil Studios NSString category?)\n     static const CGFloat kSubtitleHeight = 50;\n-    CGSize expectedSubtitleSize = [self.subtitle sizeWithFont:self.subtitleLabel.font\n-                                            constrainedToSize:CGSizeMake(textWidth, kSubtitleHeight)];\n+    CGSize expectedSubtitleSize;\n+    \n+    // use new sizeWithAttributes: if possible\n+    SEL selector = NSSelectorFromString(@\"sizeWithAttributes:\");\n+    if ([self.subtitle respondsToSelector:selector]) {\n+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000\n+        NSDictionary *attributes = @{NSFontAttributeName:self.subtitleLabel.font};\n+        CGRect rect = [self.subtitle boundingRectWithSize:CGSizeMake(textWidth, kSubtitleHeight) options:NSStringDrawingUsesLineFragmentOrigin attributes:attributes context:nil];\n+        expectedSubtitleSize = rect.size;\n+#endif\n+    }\n+    \n+    // otherwise use old sizeWithFont:\n+    else {\n+#if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 // only when deployment target is < ios7\n+        textSize = [self.textLabel.text sizeWithFont:self.textLabel.font];","path":"Objective-C/MPGNotification/MPGNotification.m","position":43,"original_position":43,"commit_id":"0ea40f0b972a422f035f5893306a820846c4c40d","original_commit_id":"0ea40f0b972a422f035f5893306a820846c4c40d","user":{"login":"toblerpwn","id":1731512,"avatar_url":"https://avatars.githubusercontent.com/u/1731512?","gravatar_id":"01d2831ddecf9af29bc3cbb9273cfc0f","url":"https://api.github.com/users/toblerpwn","html_url":"https://github.com/toblerpwn","followers_url":"https://api.github.com/users/toblerpwn/followers","following_url":"https://api.github.com/users/toblerpwn/following{/other_user}","gists_url":"https://api.github.com/users/toblerpwn/gists{/gist_id}","starred_url":"https://api.github.com/users/toblerpwn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toblerpwn/subscriptions","organizations_url":"https://api.github.com/users/toblerpwn/orgs","repos_url":"https://api.github.com/users/toblerpwn/repos","events_url":"https://api.github.com/users/toblerpwn/events{/privacy}","received_events_url":"https://api.github.com/users/toblerpwn/received_events","type":"User","site_admin":false},"body":"i think `textSize` should be `expectedSubtitleSize`, right?","created_at":"2014-07-28T21:15:30Z","updated_at":"2014-07-28T21:15:30Z","html_url":"https://github.com/MPGNotification/MPGNotification/pull/14#discussion_r15491393","pull_request_url":"https://api.github.com/repos/MPGNotification/MPGNotification/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/MPGNotification/MPGNotification/pulls/comments/15491393"},"html":{"href":"https://github.com/MPGNotification/MPGNotification/pull/14#discussion_r15491393"},"pull_request":{"href":"https://api.github.com/repos/MPGNotification/MPGNotification/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/MPGNotification/MPGNotification/pulls/14","id":18944037,"html_url":"https://github.com/MPGNotification/MPGNotification/pull/14","diff_url":"https://github.com/MPGNotification/MPGNotification/pull/14.diff","patch_url":"https://github.com/MPGNotification/MPGNotification/pull/14.patch","issue_url":"https://api.github.com/repos/MPGNotification/MPGNotification/issues/14","number":14,"state":"open","title":"Solved deprecated sizeWithFont:constrainedToSize","user":{"login":"wanchopeblanco","id":5465182,"avatar_url":"https://avatars.githubusercontent.com/u/5465182?","gravatar_id":"ec23d6610482d6f8f3635daa17d7046c","url":"https://api.github.com/users/wanchopeblanco","html_url":"https://github.com/wanchopeblanco","followers_url":"https://api.github.com/users/wanchopeblanco/followers","following_url":"https://api.github.com/users/wanchopeblanco/following{/other_user}","gists_url":"https://api.github.com/users/wanchopeblanco/gists{/gist_id}","starred_url":"https://api.github.com/users/wanchopeblanco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wanchopeblanco/subscriptions","organizations_url":"https://api.github.com/users/wanchopeblanco/orgs","repos_url":"https://api.github.com/users/wanchopeblanco/repos","events_url":"https://api.github.com/users/wanchopeblanco/events{/privacy}","received_events_url":"https://api.github.com/users/wanchopeblanco/received_events","type":"User","site_admin":false},"body":"Solved deprecated sizeWithFont:constrainedToSize\r\nSolved warnings of const to NSString\r\nSolved warning when using int in nslog\r\n\r\nAdded only show the swipe hint view if swipeToDismissEnabled is true","created_at":"2014-07-27T20:28:46Z","updated_at":"2014-07-28T21:15:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"90376ffb76f5d02140077d3a9bb0d8cf532b9c68","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MPGNotification/MPGNotification/pulls/14/commits","review_comments_url":"https://api.github.com/repos/MPGNotification/MPGNotification/pulls/14/comments","review_comment_url":"https://api.github.com/repos/MPGNotification/MPGNotification/pulls/comments/{number}","comments_url":"https://api.github.com/repos/MPGNotification/MPGNotification/issues/14/comments","statuses_url":"https://api.github.com/repos/MPGNotification/MPGNotification/statuses/0ea40f0b972a422f035f5893306a820846c4c40d","head":{"label":"wanchopeblanco:master","ref":"master","sha":"0ea40f0b972a422f035f5893306a820846c4c40d","user":{"login":"wanchopeblanco","id":5465182,"avatar_url":"https://avatars.githubusercontent.com/u/5465182?","gravatar_id":"ec23d6610482d6f8f3635daa17d7046c","url":"https://api.github.com/users/wanchopeblanco","html_url":"https://github.com/wanchopeblanco","followers_url":"https://api.github.com/users/wanchopeblanco/followers","following_url":"https://api.github.com/users/wanchopeblanco/following{/other_user}","gists_url":"https://api.github.com/users/wanchopeblanco/gists{/gist_id}","starred_url":"https://api.github.com/users/wanchopeblanco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wanchopeblanco/subscriptions","organizations_url":"https://api.github.com/users/wanchopeblanco/orgs","repos_url":"https://api.github.com/users/wanchopeblanco/repos","events_url":"https://api.github.com/users/wanchopeblanco/events{/privacy}","received_events_url":"https://api.github.com/users/wanchopeblanco/received_events","type":"User","site_admin":false},"repo":{"id":22320941,"name":"MPGNotification","full_name":"wanchopeblanco/MPGNotification","owner":{"login":"wanchopeblanco","id":5465182,"avatar_url":"https://avatars.githubusercontent.com/u/5465182?","gravatar_id":"ec23d6610482d6f8f3635daa17d7046c","url":"https://api.github.com/users/wanchopeblanco","html_url":"https://github.com/wanchopeblanco","followers_url":"https://api.github.com/users/wanchopeblanco/followers","following_url":"https://api.github.com/users/wanchopeblanco/following{/other_user}","gists_url":"https://api.github.com/users/wanchopeblanco/gists{/gist_id}","starred_url":"https://api.github.com/users/wanchopeblanco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wanchopeblanco/subscriptions","organizations_url":"https://api.github.com/users/wanchopeblanco/orgs","repos_url":"https://api.github.com/users/wanchopeblanco/repos","events_url":"https://api.github.com/users/wanchopeblanco/events{/privacy}","received_events_url":"https://api.github.com/users/wanchopeblanco/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wanchopeblanco/MPGNotification","description":"MPGNotifications is an iOS control that allows you to display in-app interactive notifications that are fully customisable to suit your needs.","fork":true,"url":"https://api.github.com/repos/wanchopeblanco/MPGNotification","forks_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/forks","keys_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/teams","hooks_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/hooks","issue_events_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/issues/events{/number}","events_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/events","assignees_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/assignees{/user}","branches_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/branches{/branch}","tags_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/tags","blobs_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/git/refs{/sha}","trees_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/statuses/{sha}","languages_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/languages","stargazers_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/stargazers","contributors_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/contributors","subscribers_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/subscribers","subscription_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/subscription","commits_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/commits{/sha}","git_commits_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/git/commits{/sha}","comments_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/comments{/number}","issue_comment_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/issues/comments/{number}","contents_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/contents/{+path}","compare_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/merges","archive_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/downloads","issues_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/issues{/number}","pulls_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/pulls{/number}","milestones_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/milestones{/number}","notifications_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/labels{/name}","releases_url":"https://api.github.com/repos/wanchopeblanco/MPGNotification/releases{/id}","created_at":"2014-07-27T20:14:08Z","updated_at":"2014-07-27T20:23:38Z","pushed_at":"2014-07-27T21:27:14Z","git_url":"git://github.com/wanchopeblanco/MPGNotification.git","ssh_url":"git@github.com:wanchopeblanco/MPGNotification.git","clone_url":"https://github.com/wanchopeblanco/MPGNotification.git","svn_url":"https://github.com/wanchopeblanco/MPGNotification","homepage":null,"size":456,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"MPGNotification:master","ref":"master","sha":"f841b3a5aff165cb4389d2a01288f5ac3c833582","user":{"login":"MPGNotification","id":8183096,"avatar_url":"https://avatars.githubusercontent.com/u/8183096?","gravatar_id":null,"url":"https://api.github.com/users/MPGNotification","html_url":"https://github.com/MPGNotification","followers_url":"https://api.github.com/users/MPGNotification/followers","following_url":"https://api.github.com/users/MPGNotification/following{/other_user}","gists_url":"https://api.github.com/users/MPGNotification/gists{/gist_id}","starred_url":"https://api.github.com/users/MPGNotification/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MPGNotification/subscriptions","organizations_url":"https://api.github.com/users/MPGNotification/orgs","repos_url":"https://api.github.com/users/MPGNotification/repos","events_url":"https://api.github.com/users/MPGNotification/events{/privacy}","received_events_url":"https://api.github.com/users/MPGNotification/received_events","type":"Organization","site_admin":false},"repo":{"id":21301216,"name":"MPGNotification","full_name":"MPGNotification/MPGNotification","owner":{"login":"MPGNotification","id":8183096,"avatar_url":"https://avatars.githubusercontent.com/u/8183096?","gravatar_id":null,"url":"https://api.github.com/users/MPGNotification","html_url":"https://github.com/MPGNotification","followers_url":"https://api.github.com/users/MPGNotification/followers","following_url":"https://api.github.com/users/MPGNotification/following{/other_user}","gists_url":"https://api.github.com/users/MPGNotification/gists{/gist_id}","starred_url":"https://api.github.com/users/MPGNotification/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MPGNotification/subscriptions","organizations_url":"https://api.github.com/users/MPGNotification/orgs","repos_url":"https://api.github.com/users/MPGNotification/repos","events_url":"https://api.github.com/users/MPGNotification/events{/privacy}","received_events_url":"https://api.github.com/users/MPGNotification/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MPGNotification/MPGNotification","description":"MPGNotifications is an iOS control that allows you to display in-app interactive notifications that are fully customisable to suit your needs.","fork":false,"url":"https://api.github.com/repos/MPGNotification/MPGNotification","forks_url":"https://api.github.com/repos/MPGNotification/MPGNotification/forks","keys_url":"https://api.github.com/repos/MPGNotification/MPGNotification/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MPGNotification/MPGNotification/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MPGNotification/MPGNotification/teams","hooks_url":"https://api.github.com/repos/MPGNotification/MPGNotification/hooks","issue_events_url":"https://api.github.com/repos/MPGNotification/MPGNotification/issues/events{/number}","events_url":"https://api.github.com/repos/MPGNotification/MPGNotification/events","assignees_url":"https://api.github.com/repos/MPGNotification/MPGNotification/assignees{/user}","branches_url":"https://api.github.com/repos/MPGNotification/MPGNotification/branches{/branch}","tags_url":"https://api.github.com/repos/MPGNotification/MPGNotification/tags","blobs_url":"https://api.github.com/repos/MPGNotification/MPGNotification/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MPGNotification/MPGNotification/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MPGNotification/MPGNotification/git/refs{/sha}","trees_url":"https://api.github.com/repos/MPGNotification/MPGNotification/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MPGNotification/MPGNotification/statuses/{sha}","languages_url":"https://api.github.com/repos/MPGNotification/MPGNotification/languages","stargazers_url":"https://api.github.com/repos/MPGNotification/MPGNotification/stargazers","contributors_url":"https://api.github.com/repos/MPGNotification/MPGNotification/contributors","subscribers_url":"https://api.github.com/repos/MPGNotification/MPGNotification/subscribers","subscription_url":"https://api.github.com/repos/MPGNotification/MPGNotification/subscription","commits_url":"https://api.github.com/repos/MPGNotification/MPGNotification/commits{/sha}","git_commits_url":"https://api.github.com/repos/MPGNotification/MPGNotification/git/commits{/sha}","comments_url":"https://api.github.com/repos/MPGNotification/MPGNotification/comments{/number}","issue_comment_url":"https://api.github.com/repos/MPGNotification/MPGNotification/issues/comments/{number}","contents_url":"https://api.github.com/repos/MPGNotification/MPGNotification/contents/{+path}","compare_url":"https://api.github.com/repos/MPGNotification/MPGNotification/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MPGNotification/MPGNotification/merges","archive_url":"https://api.github.com/repos/MPGNotification/MPGNotification/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MPGNotification/MPGNotification/downloads","issues_url":"https://api.github.com/repos/MPGNotification/MPGNotification/issues{/number}","pulls_url":"https://api.github.com/repos/MPGNotification/MPGNotification/pulls{/number}","milestones_url":"https://api.github.com/repos/MPGNotification/MPGNotification/milestones{/number}","notifications_url":"https://api.github.com/repos/MPGNotification/MPGNotification/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MPGNotification/MPGNotification/labels{/name}","releases_url":"https://api.github.com/repos/MPGNotification/MPGNotification/releases{/id}","created_at":"2014-06-28T11:16:34Z","updated_at":"2014-07-28T14:31:32Z","pushed_at":"2014-07-28T21:06:19Z","git_url":"git://github.com/MPGNotification/MPGNotification.git","ssh_url":"git@github.com:MPGNotification/MPGNotification.git","clone_url":"https://github.com/MPGNotification/MPGNotification.git","svn_url":"https://github.com/MPGNotification/MPGNotification","homepage":null,"size":456,"stargazers_count":235,"watchers_count":235,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":14,"mirror_url":null,"open_issues_count":8,"forks":14,"open_issues":8,"watchers":235,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MPGNotification/MPGNotification/pulls/14"},"html":{"href":"https://github.com/MPGNotification/MPGNotification/pull/14"},"issue":{"href":"https://api.github.com/repos/MPGNotification/MPGNotification/issues/14"},"comments":{"href":"https://api.github.com/repos/MPGNotification/MPGNotification/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/MPGNotification/MPGNotification/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/MPGNotification/MPGNotification/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/MPGNotification/MPGNotification/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/MPGNotification/MPGNotification/statuses/0ea40f0b972a422f035f5893306a820846c4c40d"}}}}