AnimatedTextFieldCounter 0.1.0

AnimatedTextFieldCounter 0.1.0

Maintained by Azat Goktas.




  • By
  • Azat Göktaş

AnimatedTextFieldCounter

CI Status Version License Platform

Example

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

Features

  • Set Maximum Length Of UITextfield.
  • Easy Customizable From Storyboard
  • Demo

Requirements

  • iOS 9.0 or Newer

Installation

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

pod 'AnimatedTextFieldCounter'

How To Use?

Adding Programmatically

let textField = AnimatedTextFieldCounter(frame: CGRect(x: 40, y: 80, width: 320, height: 30), maxLength: 5, heightOfCounterView: 4, animationDuration: 0.2, shakeCount: 1)

self.view.addSubview(textField)

Storyboard Support.

  • Drag and drop a UITextField from Object Library.
  • Go to identity inspector and set class to AnimatedTextFieldCounter.
  • And go back to Attributes Inspector. Here we go!
  • Storyboard

Using the delegate

Import The AnimatedTextFieldCounter Class

import AnimatedTextFieldCounter

Add the delegate to your class

class ViewController: UIViewController, AnimatedTextFieldCounterDelegate

Then set the delegate

textField.counterDelegate = self

And use the reachedMaxLimit Method.

func reachedMaxLimit(textfield: AnimatedTextFieldCounter) {
    print("hey!")
}

Author

Azat Goktas, [email protected]

License

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