Latest 0.3.5
Homepage https://github.com/mandrusiaks/SMTextView
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

A custom implementation of UITextView with a placeholder and character count. This implementation contains the ability to customize top, left, and right insets individually. SMTextView is compatible with Interface Builder. SMTextView also contains a character count that can be enabled/disabled. To disable, simply set isCharacterCountEnabled to false.

NOTE: Due to character count label, bottomInset is currently no longer customizable. This may be re-enabled in the future. If character count is disabled, bottomInset = topInset.

SMTextView SMTextView2

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage

Instead of using Interface Builder, you can customize properties manually in code.

By default, SMTextView’s character count is enabled. To hide the character count for SMTextView, simply set isCharacterCountEnabled = false

Optionally, you can set maxCharacterCount. The default character count is 100.


@IBOutlet weak var textView: SMTextView!

...

override func viewDidLoad() {
    super.viewDidLoad()
    textView.placeholder = "Enter details about the event."
    textView.placeholderColor = .purple
    textView.topInset = 45
    textView.leftInset = 15
    textView.rightInset = 15
    textView.maxCharacterCount = 200
}

Requirements

Installation

CocoaPods

SMTextView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "SMTextView"

Manual

Alternatively, you can simply add SMTextView.swift to your project.

License

SMTextView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SMTextView",
    "version": "0.3.5",
    "summary": "SMTextView provides an easy way to specify a placeholder using a text view. Includes character count.",
    "description": "A custom implementation of UITextView with a placeholder and character count. This implementation contains the ability to customize top, left, and right insets individually. SMTextView is compatible with Interface Builder. SMTextView also contains a character count that can be enabled/disabled. To disable, simply set isCharacterCountEnabled to false.",
    "homepage": "https://github.com/mandrusiaks/SMTextView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "mandrusiaks": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mandrusiaks/SMTextView.git",
        "tag": "0.3.5"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "SMTextView/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This