{"action":"created","issue":{"url":"https://api.github.com/repos/fphilipe/PHFComposeBarView/issues/44","labels_url":"https://api.github.com/repos/fphilipe/PHFComposeBarView/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/fphilipe/PHFComposeBarView/issues/44/comments","events_url":"https://api.github.com/repos/fphilipe/PHFComposeBarView/issues/44/events","html_url":"https://github.com/fphilipe/PHFComposeBarView/issues/44","id":56932753,"number":44,"title":"Is the purpose to mimic the iMessage app 100%?","user":{"login":"dilizarov","id":3807722,"avatar_url":"https://avatars.githubusercontent.com/u/3807722?v=3","gravatar_id":"","url":"https://api.github.com/users/dilizarov","html_url":"https://github.com/dilizarov","followers_url":"https://api.github.com/users/dilizarov/followers","following_url":"https://api.github.com/users/dilizarov/following{/other_user}","gists_url":"https://api.github.com/users/dilizarov/gists{/gist_id}","starred_url":"https://api.github.com/users/dilizarov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dilizarov/subscriptions","organizations_url":"https://api.github.com/users/dilizarov/orgs","repos_url":"https://api.github.com/users/dilizarov/repos","events_url":"https://api.github.com/users/dilizarov/events{/privacy}","received_events_url":"https://api.github.com/users/dilizarov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-08T00:37:38Z","updated_at":"2015-03-12T23:02:52Z","closed_at":"2015-03-12T23:02:52Z","body":"I have altered the library code in my app a bit to function more as one would expect.\r\n\r\nNamely, I altered button enabling:\r\n\r\n    - (void)updateButtonEnabled {\r\n        BOOL enabled = [self isEnabled] && [[[[self textView] text] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] > 0;\r\n    \r\n        if (_maxCharCount > 0) {\r\n            enabled = [[[[self textView] text] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] <= _maxCharCount;\r\n        }\r\n    \r\n        [[self button] setEnabled:enabled];\r\n    }\r\n\r\nI think this functions a lot more as someone would expect. You do nearly all your checks on the trimmed string, so one would expect the button enabling to be the same. In the above, the button is enabled only when the length of the trimmed textView text is greater than 0 and when it is less than the maxCharCount if the maxCharCount was set.\r\n\r\nIf the purpose is to 100% mimic the iMessage app, then I won't submit a pull-request, just figure this is more intuitive with how one would expect.\r\n "},"comment":{"url":"https://api.github.com/repos/fphilipe/PHFComposeBarView/issues/comments/78677896","html_url":"https://github.com/fphilipe/PHFComposeBarView/issues/44#issuecomment-78677896","issue_url":"https://api.github.com/repos/fphilipe/PHFComposeBarView/issues/44","id":78677896,"user":{"login":"fphilipe","id":128151,"avatar_url":"https://avatars.githubusercontent.com/u/128151?v=3","gravatar_id":"","url":"https://api.github.com/users/fphilipe","html_url":"https://github.com/fphilipe","followers_url":"https://api.github.com/users/fphilipe/followers","following_url":"https://api.github.com/users/fphilipe/following{/other_user}","gists_url":"https://api.github.com/users/fphilipe/gists{/gist_id}","starred_url":"https://api.github.com/users/fphilipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fphilipe/subscriptions","organizations_url":"https://api.github.com/users/fphilipe/orgs","repos_url":"https://api.github.com/users/fphilipe/repos","events_url":"https://api.github.com/users/fphilipe/events{/privacy}","received_events_url":"https://api.github.com/users/fphilipe/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T23:02:52Z","updated_at":"2015-03-12T23:02:52Z","body":"Yes, the idea is to mimic iMessage as close as possible. This functionality can be easily implemented with the delegate messages."}}