Latest 0.1.1
Homepage https://github.com/Farshadgh/FRTextFieldAnimation
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

[![Swift Version][swift-image]][swift-url]
[![CocoaPods version][cocoapods-version-image]][cocoapods]
[![License][license-image]][license-url]

This library shows text fields with beautiful placeholder animation when are selected

Example

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

Requirements

  • Swift 4.0 or higher
  • iOS 8.0
  • XCode 9.0

Installation

Cocoapods

Install Cocoapods if need be.

$ gem install cocoapods

Add FRTextFieldAnimation in your Podfile.

use_frameworks!

pod 'FRTextFieldAnimation'

Then, run the following command.

$ pod install

Usage

Find a sample code for iOS here.

Initialization

import FRTextFieldAnimation
@IBOutlet weak var textView: FRTextFieldAnimation!
textView.placeHolderFont = UIFont.boldSystemFont(ofSize: 20)
textView.textFieldFont = UIFont.boldSystemFont(ofSize: 15)
textView.placeHolderTitle = "Phone number"
textView.placeHolderColor = UIColor.red
textView.lineColor = UIColor.purple
textView.textColor = UIColor.darkGray
textView.textLimit = 11
textView.keyboardType = .numberPad

if you want to use textfield delegates methods

textView.delegate = self
extension ViewController: AnimatedTextInputDelegate {
func animatedTextInputDidEndEditing(animatedTextInput: FRTextFieldInput) {
//code
}

func animatedTextInputDidBeginEditing(animatedTextInput: FRTextFieldInput) {
//code
}

func animatedTextInputDidChange(animatedTextInput: FRTextFieldInput) {
//code
}

func animatedTextInputShouldReturn(animatedTextInput: FRTextFieldInput) -> Bool {
animatedTextInput.resignFirstResponder()
return true
}

func animatedTextInputShouldBeginEditing(animatedTextInput: FRTextFieldInput) -> Bool {
return true
}

func animatedTextInputShouldEndEditing(animatedTextInput: FRTextFieldInput) -> Bool {
return true
}
}

Author

Farshad Ghafari, [email protected]

License

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

Latest podspec

{
    "name": "FRTextFieldAnimation",
    "version": "0.1.1",
    "summary": "Texfield with placeholder animation",
    "description": "A framework to show text fields with beautiful placeholder animation when are selected",
    "homepage": "https://github.com/Farshadgh/FRTextFieldAnimation",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Farshad Ghafari": "[email protected]"
    },
    "swift_version": "4.0",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/Farshadgh/FRTextFieldAnimation.git",
        "tag": "0.1.1"
    },
    "source_files": "Source/FRTextFieldAnimation/**/*.swift",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This