{"id":13995247,"url":"https://github.com/luximetr/AnyFormatKit","last_synced_at":"2025-07-22T21:32:27.489Z","repository":{"id":47096453,"uuid":"108993031","full_name":"luximetr/AnyFormatKit","owner":"luximetr","description":"Simple text formatting in Swift","archived":false,"fork":false,"pushed_at":"2022-01-27T10:40:19.000Z","size":1605,"stargazers_count":425,"open_issues_count":2,"forks_count":59,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-04-24T18:33:09.041Z","etag":null,"topics":["anyformat","anyformatkit","card-number","carthage","cocoapods","currency","currency-format","currency-formatter","delegate","formatter","formatters","phone-number","regex","swift","symbols","uitextfield","uitextview","xcode"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luximetr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-31T12:33:16.000Z","updated_at":"2024-04-11T08:38:08.000Z","dependencies_parsed_at":"2022-08-21T01:50:40.499Z","dependency_job_id":null,"html_url":"https://github.com/luximetr/AnyFormatKit","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luximetr%2FAnyFormatKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luximetr%2FAnyFormatKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luximetr%2FAnyFormatKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luximetr%2FAnyFormatKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luximetr","download_url":"https://codeload.github.com/luximetr/AnyFormatKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226910599,"owners_count":17701848,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anyformat","anyformatkit","card-number","carthage","cocoapods","currency","currency-format","currency-formatter","delegate","formatter","formatters","phone-number","regex","swift","symbols","uitextfield","uitextview","xcode"],"created_at":"2024-08-09T14:03:19.302Z","updated_at":"2024-11-29T17:31:18.879Z","avatar_url":"https://github.com/luximetr.png","language":"Swift","readme":"![AnyFormatKit: Simple text formatting in Swift](Assets/anyformatkit.jpeg)\n\n\n[![CI Status](http://img.shields.io/travis/luximetr/AnyFormatKit.svg?style=flat)](https://travis-ci.org/luximetr/AnyFormatKit)\n[![Pod Version](https://img.shields.io/cocoapods/v/AnyFormatKit.svg?style=flat)](http://cocoapods.org/pods/AnyFormatKit)\n[![License](https://img.shields.io/cocoapods/l/AnyFormatKit.svg?style=flat)](http://cocoapods.org/pods/AnyFormatKit)\n[![Platform](https://img.shields.io/cocoapods/p/AnyFormatKit.svg?style=flat)](http://cocoapods.org/pods/AnyFormatKit)\n[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://swift.org/package-manager/)\n![Swift](https://img.shields.io/badge/%20in-swift%205.0-brightgreen.svg)\n\nText formatting framework written on Swift 5.0.\n\n## Features\n\n| |Features |\n|-------------------|------------------------------------------------------------|\n:performing_arts:| Convert string into formatted string and vice versa\n:bicyclist:| Formatting text during typing\n:hash:| Set format using '#' characters like '### ##-###'\n:stuck_out_tongue:| Supporting emojis\n:heavy_dollar_sign:| Formatting money amount\n:parking:| Formatting with placeholders\n:seedling:| UITextField and UITextView support\n\n\n## Example\n\nTo run the example project, clone the repo and run `pod install` from the Example directory first.\n\n## Demo\n\n![Phone number example](Assets/example_phone_number.gif)\n\n![Currency example](Assets/example_sum.gif)\n\n![Card number example](Assets/example_card_number.gif)\n\n![Placeholder number number example](Assets/example_placeholder_phone_number.gif)\n\n## Requirements\n\n- iOS 8.0+\n- Swift 4.0+\n- Xcode 9.0+\n\n## SwiftUI\n\nAnyFormatKit has SwiftUI version, that exists as separate framework [AnyFormatKitSwiftUI](https://github.com/luximetr/AnyFormatKitSwiftUI)\n\n## Migration Guides\n\n- [AnyFormatKit 0.2.0 MigrationGuide](Documentation/AnyFormatKit%200.2.0%20MigrationGuide.md)\n- [AnyFormatKit 1.0.0 MigrationGuide](Documentation/AnyFormatKit%201.0.0%20MigrationGuide.md)\n- [AnyFormatKit 2.4.0 MigrationGuide](Documentation/AnyFormatKit%202.4.0%20MigrationGuide.md)\n\n## Installation\n\n### CocoaPods\n\nAnyFormatKit is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'AnyFormatKit', '~\u003e 2.5.2'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### Swift Package Manager\nAnyFormatKit is available with [Swift Package Manager](https://swift.org/package-manager/). \nOnce you have your Swift package set up, than simply add AnyFormatKit to the `dependencies` value of your `Package.swift`\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/luximetr/AnyFormatKit.git\", .upToNextMajor(from: \"2.5.2\"))\n]\n```\n\n## Usage\n\n### Import\n\n```swift\nimport AnyFormatKit\n```\n\n#### Formatting with TextFormatter\n\n```swift\nlet phoneFormatter = DefaultTextInputFormatter(textPattern: \"### (###) ###-##-##\")\nlet phoneInputController = TextFieldInputController()\n\ntextField.delegate = phoneInputController\nphoneInputController.formatter = phoneFormatter\n```\n\n#### Get only your input\n```swift\nphoneNumberFormatter.unformat(\"+51 (013) 442-55-11\") // +51013442551 \n```\n\n#### In case you want to use `textField.delegate` by yourself \n\n```swift\nlet phoneFormatter = DefaultTextInputFormatter(textPattern: \"### (###) ###-##-##\")\n\n// inside of UITextFieldDelegate shouldChangeTextIn method\nlet result = formatter.formatInput(currentText: textField.text ?? \"\", range: range, replacementString: string)\ntextField.text = result.formattedText\ntextField.setCursorLocation(result.caretBeginOffset)\n```\n\n\u003e You can find example of `setCursorLocation` [here](Source/Extensions/UITextField%2BExtension.swift) \n\n### Formatter kinds\n\n- `DefaultTextInputFormatter` - formatting [symbol by symbol](Assets/example_phone_number.gif)\n- `SumTextInputFormatter` - formatting like a [money format](Assets/example_sum.gif)\n- `PlaceholderTextInputFormatter` - formatting with all textPattern as [placeholder](Assets/example_placeholder_phone_number.gif)\n\n## Author\n\nluximetr, luximetr.notification@gmail.com\n\n### Say thank you\n\n\u003ca href=\"https://paypal.me/luximetr/\"\u003e\u003cimg src=\"https://github.com/andreostrovsky/donate-with-paypal/blob/master/PNG/blue.png\" height=\"40\"\u003e\u003c/a\u003e\n\n## License\n\nAnyFormatKit is available under the MIT license. See the LICENSE file for more info.\n","funding_links":["https://paypal.me/luximetr/"],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluximetr%2FAnyFormatKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluximetr%2FAnyFormatKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluximetr%2FAnyFormatKit/lists"}