{"id":17858484,"url":"https://github.com/serheo/shsphonecomponent","last_synced_at":"2025-10-07T08:08:50.643Z","repository":{"id":62453720,"uuid":"9821446","full_name":"Serheo/SHSPhoneComponent","owner":"Serheo","description":"UITextField and NSFormatter subclasses for formatting phone numbers. Allow different formats for different countries(patterns).","archived":false,"fork":false,"pushed_at":"2018-12-24T03:30:46.000Z","size":437,"stargazers_count":366,"open_issues_count":3,"forks_count":53,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-09-17T04:05:49.628Z","etag":null,"topics":["formatter","ios","nsformatter-subclasses","objective-c","phone","phone-format","phone-formatter","uitextfield"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/Serheo.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":"2013-05-02T19:58:29.000Z","updated_at":"2025-09-04T11:38:29.000Z","dependencies_parsed_at":"2022-11-01T22:32:34.006Z","dependency_job_id":null,"html_url":"https://github.com/Serheo/SHSPhoneComponent","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/Serheo/SHSPhoneComponent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Serheo%2FSHSPhoneComponent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Serheo%2FSHSPhoneComponent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Serheo%2FSHSPhoneComponent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Serheo%2FSHSPhoneComponent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Serheo","download_url":"https://codeload.github.com/Serheo/SHSPhoneComponent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Serheo%2FSHSPhoneComponent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278740839,"owners_count":26037481,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["formatter","ios","nsformatter-subclasses","objective-c","phone","phone-format","phone-formatter","uitextfield"],"created_at":"2024-10-28T05:07:18.182Z","updated_at":"2025-10-07T08:08:50.626Z","avatar_url":"https://github.com/Serheo.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"SHSPhoneComponent \u003ca href=\"https://travis-ci.org/Serheo/SHSPhoneComponent\"\u003e\u003cimg src=\"https://travis-ci.org/Serheo/SHSPhoneComponent.png\"/\u003e\u003c/a\u003e\n=================\n\nUITextField and NSFormatter subclasses for formatting phone numbers. Allow different formats for different countries(patterns).\nCaret positioning works excellent.\n\nSwift version is here - https://github.com/Serheo/PhoneNumberFormatter\n## How To Install\nUse any of next methods:\n- use embedded framework /SHSPhoneComponents/SHSPhoneComponent.xcodeproj (iOS 8+)\n- pod 'SHSPhoneComponent' \n- copy /SHSPhoneComponents/Library folder to your project.\n\nAnd import \"SHSPhoneLibrary.h\" on your Controller.\n\n## Example Usage\nIf you need complete example please see 'Example_iOS7+' or 'Example_iOS8+embedded' folders.\n\n### Default Format\n``` objective-c\n[self.phoneField.formatter setDefaultOutputPattern:@\"+# (###) ###-##-##\"];\n```\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"http://serheo.github.io/SHSPhoneComponent/readme/r1.jpg\" alt=\"shspc example 1\"/\u003e\n\u003c/p\u003e\nAll input strings will be parsed in that way. \nExample: +7 (920) 123-45-67\n\n### Prefix Format\nYou can set prefix on all inputs:\n``` objective-c\n[self.phoneField.formatter setDefaultOutputPattern:@\"(###) ###-##-##\"];\nself.phoneField.formatter.prefix = @\"+7 \";\n```\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"http://serheo.github.io/SHSPhoneComponent/readme/r7.jpg\" alt=\"shspc example 1\"/\u003e\n\u003c/p\u003e\n\n\n### Multiple Formats\n\n``` objective-c\n[self.phoneField.formatter setDefaultOutputPattern:@\"##########\" imagePath:nil];\n[self.phoneField.formatter addOutputPattern:@\"+# (###) ###-##-##\" forRegExp:@\"^7[0-689]\\\\d*$\" imagePath:@\"flagRU\"];\n[self.phoneField.formatter addOutputPattern:@\"+### (##) ###-###\" forRegExp:@\"^374\\\\d*$\" imagePath:@\"flagAM\"];\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"http://serheo.github.io/SHSPhoneComponent/readme/r2.jpg\" alt=\"shspc example 2\"/\u003e\n\u003c/p\u003e\n\n### Multiple Formats with prefix\n\n``` objective-c\n[self.phoneField.formatter setDefaultOutputPattern:@\"### ### ###\"];\nself.phoneField.formatter.prefix = @\"+7 \";\n[self.phoneField.formatter addOutputPattern:@\"(###) ###-##-##\" forRegExp:@\"^1\\\\d*$\" imagePath:@\"SHSPhoneImage.bundle/flag_ru\"];\n[self.phoneField.formatter addOutputPattern:@\"(###) ###-###\" forRegExp:@\"^2\\\\d*$\" imagePath:@\"SHSPhoneImage.bundle/flag_ua\"];\n```\n  \n### Specific Formats\nIf you want to format some numbers in specific way just do\n``` objective-c\n[self.phoneField.formatter addOutputPattern:@\"+# (###) ###-##-##\" forRegExp:@\"^7[0-689]\\\\d*$\" imagePath:@\"flagRU\"];\n[self.phoneField.formatter addOutputPattern:@\"+### (##) ###-###\" forRegExp:@\"^374\\\\d*$\" imagePath:@\"flagAM\"];\n```\n\n## Formatting\nIf you need only formatting function you can use SHSPhoneNumberFormatter class. \nFor additional class info see http://serheo.github.io/SHSPhoneComponent/\n\n## Issues and Solutions\nif you are using any predictions/suggestion in the textfield, set hasPredictiveInput flag to YES.\n\n## Requirements\nARC Enabled.\niOS 7+\n\n## License\nSHSPhoneComponent is available under the MIT license. See the LICENSE file for more info.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserheo%2Fshsphonecomponent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserheo%2Fshsphonecomponent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserheo%2Fshsphonecomponent/lists"}