Latest 0.2.3
Homepage https://github.com/rlaguilar/MultilineTextField
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

CI Status
Version
License
Platform

This can be seen as a UITextField with multiple lines, but under the hood it is just a UITextView which aims to provide many of the functionalities currently available in the UITextField class. Currently the following functionalities are supported:

  • Multiple lines
  • Customizable left view
  • Customizable placeholder text

Usage

Via storyboards

Add a UITextView and set its custom class to MultilineTextField. From the storyboard you can customize the placeholder text and also an image to be shown at the left of the field text.

Via code

First of all you have to import the library import MultilineTextField.

After that just create an instance of the view an customize its properties:

let textField = MultiplelineTextField(frame: textFieldFrame)
textField.leftView = UIImageView(image: image)
// or use the convenience property:
// textField.leftImage to assign an image directly

// below are properties that can be optionally customized
textField.placeholder = "This is my placeholder"
textField.placeholderColor = UIColor.red
textField.isPlaceholderScrollEnabled = true
textField.leftViewOrigin = CGPoint(x: 8, y: 8)
someView.addSubview(textField)

Example

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

Requirements

It requires Swift 4 and Xcode 9 or above

Installation

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

pod 'MultilineTextField'

Author

Reynaldo Aguilar, rlaguilar

License

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

Latest podspec

{
    "name": "MultilineTextField",
    "version": "0.2.3",
    "summary": "UITextField with multiple lines (or UITextView with placeholder)",
    "description": "This can be seen as a `UITextField` with multiple lines, but under the hood it is just a `UITextView` which aims to provide many of the functionalities currently available in the `UITextField` class. Currently the following functionalities are supported:nn+ Multiple linesn+ Customizable left viewn+ Customizable placeholder text",
    "homepage": "https://github.com/rlaguilar/MultilineTextField",
    "screenshots": [
        "https://raw.githubusercontent.com/rlaguilar/MultilineTextField/master/Example/img-multiple-lines.jpg",
        "https://raw.githubusercontent.com/rlaguilar/MultilineTextField/master/Example/img-placeholder.jpg"
    ],
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "rlaguilar": "[email protected]"
    },
    "source": {
        "git": "https://github.com/rlaguilar/MultilineTextField.git",
        "tag": "0.2.3"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "MultilineTextField/Classes/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This