Latest 1.0.3
Homepage https://github.com/GurinderBatth/GBFloatingTextField
License MIT
Platforms ios 9.0
Authors

CI Status
Version
License
Platform

Example

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

Requirements

  • iOS 8.0+
  • Xcode 8.3+
  • Swift 3.2+

Installation

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

pod 'GBFloatingTextField'

New in GBFloatingTextField

Add same functionality for TextView. Please check Usage of GBFloatingTextView for more info.

Usage Of GBFloatingTextField

To create an instance of the class, use Interface builder, or do it from code. This example will create the following textField with the placeholder, title , Line and error message:

let textField = GBTextField(frame: CGRect(x:10, y: 100, width: UIScreen.main.bounds.width - 20, height: 40))
textField.lineColor = .black
textField.titleLabelColor = .black
textField.lineHeight = 1
textField.showErrorMessage("This is Text Error")
self.view.addSubview(textField)

There are list of Properties you can change . Please check those your customization.

Usage Of GBFloatingTextView

To create an instance of the class, use Interface builder, or do it from code. This example will create the following textView with the placeholder and title:

You don’t need to add this view to Superview just pass the superview when create instance of GBFloatingTextView. Like in Example.

let textView = GBFloatingTextView(frame: CGRect(x: 10, y: 200, width: 355, height: 150), superView: self.view)
textView.isFloatingLabel = true
textView.placeholder = "GBFloating TextView"

To change Placeholder Color, Top Placeholder Color or Selected Placeholer Color. Please check these properties

textView.placeholderColor = .gray
textView.topPlaceholderColor = .black
textView.selectedColor = .red

To enable Floating Text in GBFlaotingTextView. Please enable "isFloatingLabel" , expect this will hide the Floating text like placeholder text in UITextField.

isFloatingLabel is false by default. Please make it true for Floating Placeholder.

You can change these all Properties in Interface builder for both GBFloatingTextField and GBFloatingTextView.

Contributing

We welcome all contributions.

Author

Gurinder Batth, [email protected]

Credits

Credits for the Secure Entry bug , and improving it with the help of SkyFloatingLabelTextField.

Special Thanks

Special thanks to [Mixel]( https://stackoverflow.com/users/746347/mixel) for animate the floating text in UITextView.

License

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

Known Issue

It wil not work if the clipsToBounds or masksToBounds property is true.

About Future Versions

  1. Working on make this Class for UITextView.
  2. Solve known issues
  3. We will try to make custom everything so everyone can use according to there needs.
  4. Will add RTL language support.

Latest podspec

{
    "name": "GBFloatingTextField",
    "version": "1.0.3",
    "summary": "GBFloatingTextField is a Floting TextField.",
    "description": "GBFloatingTextField is a Floting TextField. Which also contains Left Image and Right Image. You also perform actions on Both Images.",
    "homepage": "https://github.com/GurinderBatth/GBFloatingTextField",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Gurinder Batth": "[email protected]"
    },
    "source": {
        "git": "https://github.com/GurinderBatth/GBFloatingTextField.git",
        "tag": "1.0.3"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "GBFloatingTextField/Classes/**/*",
    "swift_version": "3.2"
}

Pin It on Pinterest

Share This