Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devxoul/uitextview-placeholder
A missing placeholder for UITextView
https://github.com/devxoul/uitextview-placeholder
objective-c placeholder uitextview
Last synced: 1 day ago
JSON representation
A missing placeholder for UITextView
- Host: GitHub
- URL: https://github.com/devxoul/uitextview-placeholder
- Owner: devxoul
- License: mit
- Created: 2014-12-10T15:18:38.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-10-20T08:49:23.000Z (over 4 years ago)
- Last Synced: 2024-10-29T17:50:02.458Z (3 months ago)
- Topics: objective-c, placeholder, uitextview
- Language: Objective-C
- Homepage:
- Size: 85.9 KB
- Stars: 1,476
- Watchers: 21
- Forks: 259
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
UITextView+Placeholder
======================[![Build Status](https://travis-ci.org/devxoul/UITextView-Placeholder.svg?branch=master)](https://travis-ci.org/devxoul/UITextView-Placeholder)
[![CocoaPods](http://img.shields.io/cocoapods/v/UITextView+Placeholder.svg?style=flat)](http://cocoapods.org/?q=name%3AUITextView%2BPlaceholder)A missing placeholder for UITextView.
Installation
------------Use [CocoaPods](http://cocoapods.org).
```ruby
pod 'UITextView+Placeholder'
```Usage
------ **Import Dynamic Framework**:
e.g. If you're using CocoaPods with `use_frameworks!` flag.
```objc
@import UITextView_Placeholder;
```
- **Import Static Library**:```objc
#import
```Then create `UITextView` and set `placeholder`.
- **Implement Objective-C**:
```objc
UITextView *textView = [[UITextView alloc] init];
textView.placeholder = @"How are you?";
textView.placeholderColor = [UIColor lightGrayColor]; // optional
textView.attributedPlaceholder = ... // NSAttributedString (optional)
```- **Implement Swift**:
```swift
let textView = UITextView()
textView.placeholder = "How are you?"
textView.placeholderColor = UIColor.lightGray // optional
textView.attributedPlaceholder = ... // NSAttributedString (optional)
```Congratulations! You're done. 🎉
License
-------UITextView+Placeholder is under MIT license. See the [LICENSE](LICENSE) file for more information.