Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/DigitalLeaves/PlaceholderTextViewDemo
A IBDesignable subclass of UITextView with a placeholder behaving like a UITextfield
https://github.com/DigitalLeaves/PlaceholderTextViewDemo
Last synced: 1 day ago
JSON representation
A IBDesignable subclass of UITextView with a placeholder behaving like a UITextfield
- Host: GitHub
- URL: https://github.com/DigitalLeaves/PlaceholderTextViewDemo
- Owner: DigitalLeaves
- Created: 2015-02-26T19:46:36.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-04T12:40:40.000Z (about 7 years ago)
- Last Synced: 2024-08-03T14:10:15.391Z (3 months ago)
- Language: Swift
- Size: 32.2 KB
- Stars: 45
- Watchers: 5
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PlaceholderTextView
PlaceHolderTextView is a IBDesignable subclass of UITextView with a placeholder behaving like a UITextfield, which means that if no text is present, the placeholder will be showing. This makes it easier to integrate UITextViews in combination of UITextFields where all the elements should have placeholders.
There is a full tutorial on how to build your custom IBDesignable controls for XCode6 [here](http://digitalleaves.com/blog/building-your-custom-ibdesignable-controls-and-views/).
## Usage
Just drag & drop the file PlaceholderTextView.swift into your project. Then in the Interface Builder, add a UITextView to any of your UIViewControllers.
Click on the Identity Inspector (the icon that looks like an id card or a user profile page on the utilities right panel). Write "PlaceholderTextView" in the "Class" field, and you are ready!
Use the Attribute Inspector to change the placeholder text and color. You can also change the corner radius for rounded edges, and set the width and color of the border around the PlaceholderTextView.
## License
The MIT License (MIT)
Copyright (c) 2015 Ignacio Nieto Carvajal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.