Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/richa008/CurrencyTextField
UITextField that automatically formats text to display in the currency format
https://github.com/richa008/CurrencyTextField
currencytextfield ios swift swift4 uitextfield
Last synced: 6 days ago
JSON representation
UITextField that automatically formats text to display in the currency format
- Host: GitHub
- URL: https://github.com/richa008/CurrencyTextField
- Owner: richa008
- License: mit
- Created: 2016-06-01T23:19:32.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-05-01T03:35:35.000Z (over 4 years ago)
- Last Synced: 2024-12-01T10:23:14.626Z (12 days ago)
- Topics: currencytextfield, ios, swift, swift4, uitextfield
- Language: Swift
- Homepage:
- Size: 434 KB
- Stars: 51
- Watchers: 2
- Forks: 24
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - CurrencyTextField - UITextField that automatically formats text to display in the currency format. (UI / TextField & TextView)
- awesome-ios-star - CurrencyTextField - UITextField that automatically formats text to display in the currency format. (UI / TextField & TextView)
README
# CurrencyTextField
The numbers that the user enters in the field are automatically formatted to display in the dollar amount format. For example, if the user enters the numbers 1 and 2, the text in the field is formatted to display $0.12 . If the user enters 3, 4, 5, 6 after that.. the field displays $1,234.56
If the user presses the delete key, the text field displays $123.45## Demo
![Alt text](https://raw.githubusercontent.com/richa008/CurrencyTextField/master/Screenshots/CurrencyTextFieldExample.gif "ExampleCurrency gif")
## Installation
**CocoaPods**
Add the dependency to your Podfile:
```
use_frameworks!target TARGET_NAME do
pod 'CurrencyTextField'
end
```Run pod install to install the dependencies.
**Source files**
Clone this repository or download it in zip-file. Then you will find source files under CurrencyTextField directory. Copy them to your project.
## Usage
Import CurrencyTextField and add it programatically to your view or add UITextField in your Storyboard, and then change the custom class to CurrencyTextField
![Alt text](https://raw.githubusercontent.com/richa008/CurrencyTextField/master/Screenshots/CustomClassSelect.png "Custom class")
```
@IBOutlet weak var textField: CurrencyTextField!
```## License
CurrencyTextField is released under the MIT license.