Swiftpack.co - Package - ruslanskorb/RSKPlaceholderTextView

RSKPlaceholderTextView Swift 5.1 Swift Package Manager Compatible CocoaPods Compatible Carthage compatible

Sample

A light-weight UITextView subclass that adds support for placeholder.

Installation

Using Swift Package Manager

  1. To add the RSKPlaceholderTextView package to your Xcode project, select File > Swift Packages > Add Package Dependency and enter the repository URL.

     https://github.com/ruslanskorb/RSKPlaceholderTextView.git
    

Using CocoaPods

  1. Add the pod RSKPlaceholderTextView to your Podfile.

    pod 'RSKPlaceholderTextView'
    
  2. Run pod install from Terminal, then open your app's .xcworkspace file to launch Xcode.

Using Carthage

  1. Add the ruslanskorb/RSKPlaceholderTextView project to your Cartfile.

    github "ruslanskorb/RSKPlaceholderTextView"
    
  2. Run carthage update, then follow the additional steps required to add the iOS and/or Mac frameworks into your project.

Basic Usage

Import the module.

import RSKPlaceholderTextView

Just create a text view and set the placeholder.

override func viewDidLoad() {
    super.viewDidLoad()

    self.textView = RSKPlaceholderTextView(frame: CGRect(x: 0, y: 20, width: self.view.frame.width, height: 100))
    self.textView.placeholder = "What do you want to say about this event?"

    self.view.addSubview(self.textView)
}

Demo

Build and run the RSKPlaceholderTextViewExample project in Xcode to see RSKPlaceholderTextView in action. Have fun. Figure out hooks for customization.

Contact

Ruslan Skorb

  • http://github.com/ruslanskorb
  • http://twitter.com/ruslanskorb
  • ruslan.skorb@gmail.com

License

This project is available under the Apache License, version 2.0. See the LICENSE file for more info.

Github

link
Stars: 157

Dependencies

Used By

Total: 0

Releases

6.0.3: Fix caret rect. - 2020-03-16 06:51:38

Fixed #24.

6.0.2: Fix setting of placeholder color. - 2020-01-25 07:38:37

6.0.1: Fix setting of placeholder parameters. - 2020-01-24 19:08:47

Fixes #23.

6.0.0: Swift 5.1 + support for SPM. - 2020-01-16 16:00:43

5.0.2: Fix caret rect. - 2019-07-18 08:25:17

5.0.1: Support for multiline placeholder. - 2019-06-05 06:45:44

Thanks @sroymeetup!

5.0.0: Swift 5.0 + iOS 9.0 deployment target. - 2019-04-04 08:39:07

4.0.0: Swift 4.2 - 2018-09-20 08:48:31

3.1.0: The position of the caret rect corresponds to the effective user interface layout direction. - 2018-07-19 09:25:09

3.0.2: Support for the RTL layout direction of the user interface. - 2018-07-16 13:34:52

3.0.0: Swift 4.0 - 2017-09-25 07:55:46

2.1.1: Update attributed placeholder after changing its attributes. - 2017-07-23 20:31:54

2.1.0: Attributed placeholder & Draw the caret at the beginning of the placeholder. - 2017-07-23 18:31:46

1.2.0: Swift 2.3 - 2016-09-14 18:08:58

2.0.0: Swift 3.0 - 2016-09-14 09:56:17

1.1.1: Fix placeholder rect. - 2016-06-24 07:17:16

1.1.0: Swift 2.2 - 2016-05-19 12:23:14

1.0.0: Initial stable API release. - 2015-12-22 12:46:29

Includes the main functionality.