Skip to content
プロジェクト

devxoul/UITextView-Placeholder

GitHubで見る

概要

UITextViewに不足しているプレースホルダー機能

Web・アプリ開発

この数値の測り方

計測したスター増加

24時間
+1
7日間
+2
15日間
+3
1か月
+2

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

UITextView+Placeholder

CI Swift Package Manager

A missing placeholder for UITextView.

Note: CocoaPods support has been removed. Please use Swift Package Manager for installation.

Installation

Swift Package Manager

Add the following to your Package.swift file:

dependencies: [
    .package(url: "https://github.com/devxoul/UITextView-Placeholder.git", from: "1.5.0")
]

Or add it through Xcode:

  1. File → Add Package Dependencies...
  2. Enter https://github.com/devxoul/UITextView-Placeholder.git
  3. Select the version and add to your target

Usage

Import the module and set placeholder on your UITextView.

  • Objective-C:

    @import UITextView_Placeholder;
    
    UITextView *textView = [[UITextView alloc] init];
    textView.placeholder = @"How are you?";
    textView.placeholderColor = [UIColor lightGrayColor]; // optional
    textView.attributedPlaceholder = ... // NSAttributedString (optional)
    
  • Swift:

    import UITextView_Placeholder
    
    let textView = UITextView()
    textView.placeholder = "How are you?"
    textView.placeholderColor = UIColor.lightGray // optional
    textView.attributedPlaceholder = ... // NSAttributedString (optional)
    

Congratulations! You're done. 🎉

Development

This project uses Tuist for project generation.

# Install Tuist (if not already installed)
curl -Ls https://install.tuist.io | bash

# Generate Xcode project
tuist generate

# Build
tuist build Demo

# Run tests
tuist test

# Run the demo app
tuist run Demo

License

UITextView+Placeholder is under MIT license. See the LICENSE file for more information.

関連プロジェクトを探す

読み込み中…