{"id":15630514,"url":"https://github.com/glaszig/sztextview","last_synced_at":"2025-04-08T11:11:28.959Z","repository":{"id":7438388,"uuid":"8778091","full_name":"glaszig/SZTextView","owner":"glaszig","description":"A drop-in UITextView replacement which gives you: a placeholder.","archived":false,"fork":false,"pushed_at":"2024-04-22T21:51:10.000Z","size":151,"stargazers_count":686,"open_issues_count":3,"forks_count":102,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-01T09:33:47.294Z","etag":null,"topics":["objective-c"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/glaszig.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-03-14T15:12:43.000Z","updated_at":"2025-03-04T01:35:57.000Z","dependencies_parsed_at":"2024-06-18T12:29:25.977Z","dependency_job_id":"d3100079-a828-4d90-829a-619becf64c42","html_url":"https://github.com/glaszig/SZTextView","commit_stats":{"total_commits":151,"total_committers":19,"mean_commits":7.947368421052632,"dds":"0.23841059602649006","last_synced_commit":"2aeb6a8e3f9818a8cf70de94348ce6d172a3d6ef"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glaszig%2FSZTextView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glaszig%2FSZTextView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glaszig%2FSZTextView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glaszig%2FSZTextView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glaszig","download_url":"https://codeload.github.com/glaszig/SZTextView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247829511,"owners_count":21002997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["objective-c"],"created_at":"2024-10-03T10:33:07.747Z","updated_at":"2025-04-08T11:11:28.909Z","avatar_url":"https://github.com/glaszig.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SZTextView \n\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\nA drop-in UITextView replacement which gives you: a placeholder.  \nTechnically it differs from other solutions in that it tries to work like UITextField's private `_placeholderLabel` so you should not suffer ugly glitches like jumping text views or loads of custom drawing code.\n\n## Requirements\n\nAn iOS project. \n\n## Installation\n\nEither clone this repo and add the project to your Xcode workspace, use [CocoaPods](http://cocoapods.org) or [Carthage](https://github.com/Carthage/Carthage).\n\n#### CocoaPods\n\nAdd this to you Podfile:\n\n```ruby\npod 'SZTextView'\n```\n\n#### Carthage\n\nAdd this line to your Cartfile:\n\n```\ngithub \"glaszig/SZTextView\"\n```\n\n## Usage\n\n```objc\nSZTextView *textView = [SZTextView new];\ntextView.placeholder = @\"Enter lorem ipsum here\";\ntextView.placeholderTextColor = [UIColor lightGrayColor];\ntextView.font = [UIFont fontWithName:@\"HelveticaNeue-Light\" size:18.0];\n```\n\nAnalogously you can use the `attributedPlaceholder` property to set a fancy `NSAttributedString` as the placeholder:\n\n```objc\nNSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc] initWithString:@\"Enter lorem ipsum here\"];\n[placeholder addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(0,2)];\n[placeholder addAttribute:NSForegroundColorAttributeName value:[UIColor greenColor] range:NSMakeRange(2,4)];\n[placeholder addAttribute:NSForegroundColorAttributeName value:[UIColor blueColor] range:NSMakeRange(6,4)];\n\ntextView.attributedPlaceholder = placeholder;\n```\n\nBoth properties `placeholder` and `attributedPlaceholder` are made to stay in sync.\nIf you set an `attributedPlaceholder` and afterwards set `placeholder` to something else, the set text gets copied to the `attributedPlaceholder` while trying to keep the original text attributes.  \nAlso, `placeholder` will be set to `attributedPlaceholder.string` when using the `attributedPlaceholder` setter.\n\nA simple demo and a few unit tests are included.\n\n### Animation\n\nThe placeholder is animatable. Just configure the `double` property `fadeTime`\nto the seconds you'd like the animation to take.\n\n### User Defined Runtime Attributes\n\nIf you prefer using Interface Builder to configure your UI, you can use UDRA's to set values for `placeholder` and `placeholderTextColor`.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n# License\n\nPublished under the [MIT license](http://opensource.org/licenses/MIT).\n\n**Note**\n\nI've developed this component for [Cocktailicious](http://www.cocktailiciousapp.com). You should check it out \\*shamelessplug\\*.  \nPlease let me now if and how you use this component. I'm curious.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglaszig%2Fsztextview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglaszig%2Fsztextview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglaszig%2Fsztextview/lists"}