Giter VIP home page Giter VIP logo

gbfloatingtextfield's Introduction

GBFloatingTextField

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 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.

gbfloatingtextfield's People

Contributors

kartel avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.