Swiftpack.co - devxoul/UITextView-Placeholder as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by devxoul.
devxoul/UITextView-Placeholder 1.4.0
A missing placeholder for UITextView
⭐️ 1,471
🕓 3 years ago
.package(url: "https://github.com/devxoul/UITextView-Placeholder.git", from: "1.4.0")

UITextView+Placeholder

Build Status CocoaPods

A missing placeholder for UITextView.

Installation

Use CocoaPods.

pod 'UITextView+Placeholder'

Usage

  • Import Dynamic Framework:

    e.g. If you're using CocoaPods with use_frameworks! flag.

    @import UITextView_Placeholder;
    
  • Import Static Library:

    #import <UITextView+Placeholder/UITextView+Placeholder.h>
    

Then create UITextView and set placeholder.

  • Implement Objective-C:

    UITextView *textView = [[UITextView alloc] init];
    textView.placeholder = @"How are you?";
    textView.placeholderColor = [UIColor lightGrayColor]; // optional
    textView.attributedPlaceholder = ... // NSAttributedString (optional)
    
  • Implement 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 file for more information.

GitHub

link
Stars: 1472
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

4 years ago
  • Use placeholder as accessibility value when placeholder is visible (#72, @e-sung)

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics