UICurrencyTextField 💶 ✏️
iOS currency text field written in Swift.
Inputed numbers are automatically formatted to user Locale currency format.
Language: English, Region: Brazil
R$ - brazilian reais
Language: English, Region: United States
$ - dollars
Requirements
- Swift >= 3
Installation
CocoaPods
Tested with pod --version: 1.0.0
# Podfile
use_frameworks!
target 'YOUR_TARGET_NAME' do
pod 'UICurrencyTextField'
endReplace YOUR_TARGET_NAME and then, in the Podfile directory, type:
$ pod installUsage
create an instance
let currencyTextField = UICurrencyTextField(frame: frame)set maximum integers digits - default is 7
currencyTextField.maximumIntegers = 4enables autoclear - text will remove content when value is 0
currencyTextField.hasAutoclear = truePlease refer to `Example/` and download the demo for more detailed info. The demo shows storyboard and programmatically methods.
Contributing
Please feel free to contribute. Together we can make better reusable code. Follow Kanban project or open new issues in your fork. Every PR will be first validated by the CI service which will run the demo tests. If you develop new features or solve any issues please verify if tests keep succeeding. Feel free to help adding more tets as well.
License
UICurrencyTextField is released under the MIT license. See LICENSE for details.