{"action":"created","issue":{"url":"https://api.github.com/repos/ilyapuchka/ReadMoreTextView/issues/40","repository_url":"https://api.github.com/repos/ilyapuchka/ReadMoreTextView","labels_url":"https://api.github.com/repos/ilyapuchka/ReadMoreTextView/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/ilyapuchka/ReadMoreTextView/issues/40/comments","events_url":"https://api.github.com/repos/ilyapuchka/ReadMoreTextView/issues/40/events","html_url":"https://github.com/ilyapuchka/ReadMoreTextView/issues/40","id":300005572,"number":40,"title":"Find if the content exceeds the textview height","user":{"login":"Isuru-Nanayakkara","id":2551877,"avatar_url":"https://avatars0.githubusercontent.com/u/2551877?v=4","gravatar_id":"","url":"https://api.github.com/users/Isuru-Nanayakkara","html_url":"https://github.com/Isuru-Nanayakkara","followers_url":"https://api.github.com/users/Isuru-Nanayakkara/followers","following_url":"https://api.github.com/users/Isuru-Nanayakkara/following{/other_user}","gists_url":"https://api.github.com/users/Isuru-Nanayakkara/gists{/gist_id}","starred_url":"https://api.github.com/users/Isuru-Nanayakkara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Isuru-Nanayakkara/subscriptions","organizations_url":"https://api.github.com/users/Isuru-Nanayakkara/orgs","repos_url":"https://api.github.com/users/Isuru-Nanayakkara/repos","events_url":"https://api.github.com/users/Isuru-Nanayakkara/events{/privacy}","received_events_url":"https://api.github.com/users/Isuru-Nanayakkara/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-25T07:31:21Z","updated_at":"2018-02-27T17:58:29Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI have a textview that toggles trimming using a separate button placed outside instead of the read more link within the textview itself. Much like one in the project's example. It works fine when there is text longer than the height of the textview.\r\n\r\nThere is however a side effect. If the text is small, there is no need to toggle the trim button. I need to hide it if the content does not exceed the bounds of the textview.\r\n\r\nIs there a way to find this out?\r\n\r\nI tried getting the `contentSize` of the textview but it seems to be inaccurate. The content height and the textview frame height returns as equal.\r\n\r\n[Demo project](https://www.dropbox.com/s/bke1k93n6mp9vlo/TextTrim.zip?dl=0)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ilyapuchka/ReadMoreTextView/issues/comments/368968625","html_url":"https://github.com/ilyapuchka/ReadMoreTextView/issues/40#issuecomment-368968625","issue_url":"https://api.github.com/repos/ilyapuchka/ReadMoreTextView/issues/40","id":368968625,"user":{"login":"Isuru-Nanayakkara","id":2551877,"avatar_url":"https://avatars0.githubusercontent.com/u/2551877?v=4","gravatar_id":"","url":"https://api.github.com/users/Isuru-Nanayakkara","html_url":"https://github.com/Isuru-Nanayakkara","followers_url":"https://api.github.com/users/Isuru-Nanayakkara/followers","following_url":"https://api.github.com/users/Isuru-Nanayakkara/following{/other_user}","gists_url":"https://api.github.com/users/Isuru-Nanayakkara/gists{/gist_id}","starred_url":"https://api.github.com/users/Isuru-Nanayakkara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Isuru-Nanayakkara/subscriptions","organizations_url":"https://api.github.com/users/Isuru-Nanayakkara/orgs","repos_url":"https://api.github.com/users/Isuru-Nanayakkara/repos","events_url":"https://api.github.com/users/Isuru-Nanayakkara/events{/privacy}","received_events_url":"https://api.github.com/users/Isuru-Nanayakkara/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T17:58:29Z","updated_at":"2018-02-27T17:58:29Z","author_association":"NONE","body":"I'm not getting a value even less than what I got using `contentSize`. Below is my code.\r\n\r\n```swift\r\nlet rect = textView.layoutManager.boundingRectForCharacterRange(range: NSRange(location: 0, length: textView.text.count), inTextContainer: textView.textContainer)\r\nprint(\"TEXT HEIGHT: \\(rect.height)\")\r\n```\r\n\r\nAm I using it correctly? "}}
{"actor":{"display_login":"Isuru-Nanayakkara"}}