{"id":2933,"url":"https://github.com/andreamazz/UITextField-Shake","last_synced_at":"2025-08-03T12:31:41.272Z","repository":{"id":13946716,"uuid":"16646704","full_name":"andreamazz/UITextField-Shake","owner":"andreamazz","description":"UITextField category that adds shake animation","archived":false,"fork":false,"pushed_at":"2017-12-14T10:52:27.000Z","size":909,"stargazers_count":737,"open_issues_count":0,"forks_count":96,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-04-14T15:07:08.873Z","etag":null,"topics":[],"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/andreamazz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2014-02-08T16:04:18.000Z","updated_at":"2024-04-14T15:07:08.874Z","dependencies_parsed_at":"2022-08-25T00:21:46.730Z","dependency_job_id":null,"html_url":"https://github.com/andreamazz/UITextField-Shake","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreamazz%2FUITextField-Shake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreamazz%2FUITextField-Shake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreamazz%2FUITextField-Shake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreamazz%2FUITextField-Shake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreamazz","download_url":"https://codeload.github.com/andreamazz/UITextField-Shake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228543207,"owners_count":17934444,"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":[],"created_at":"2024-01-05T20:16:26.715Z","updated_at":"2024-12-07T00:31:07.007Z","avatar_url":"https://github.com/andreamazz.png","language":"Objective-C","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"420\" height=\"240\" src=\"assets/logo.png\"/\u003e\n\u003c/p\u003e\n\n[![Build Status](https://travis-ci.org/andreamazz/UITextField-Shake.svg)](https://travis-ci.org/andreamazz/UITextField-Shake)\n[![CocoaPods](https://cocoapod-badges.herokuapp.com/v/UITextField+Shake/badge.svg)](http://cocoapods.org/?q=summary%3Auitextfield%20name%3Ashake%2A)\n[![Cocoapods](https://cocoapod-badges.herokuapp.com/v/UITextField+Shake/badge.svg)](http://cocoapods.org/?q=summary%3Auitextfield%20name%3Ashake%2A)\n[![Coverage Status](https://coveralls.io/repos/andreamazz/UITextField-Shake/badge.svg)](https://coveralls.io/r/andreamazz/UITextField-Shake)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\nUITextField category that adds a shake animation like the password field of the OsX login screen.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href='https://appetize.io/app/20h2nwzbz128ebvwgf0kkm3tmg' alt='Live demo'\u003e\n    \u003cimg width=\"50\" height=\"60\" src=\"assets/demo.png\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Screenshot\n![UITextField+Shake](https://raw.githubusercontent.com/andreamazz/UITextField-Shake/master/assets/screenshot.gif)\n\n## Setup with CocoaPods\n```\npod 'UITextField+Shake', '~\u003e 1.2'\n```\nImport ```UITextField+Shake.h``` in your controller's header file, or ```UITextField_Shake``` if you are using the `use_frameworks!` directive.\n\n## Setup with Carthage\n```\ngithub \"andreamazz/UITextField-Shake\"\n```\n\n## Usage\n\n### In Objective-C\n\n```objc\n// Shake\n[[self.textField] shake];\n\n// Shake with the default speed\n[self.textField shake:10   // 10 times\n            withDelta:5    // 5 points wide\n];\n\n// Shake with a custom speed\n[self.textField shake:10   // 10 times\n            withDelta:5    // 5 points wide\n                speed:0.03 // 30ms per shake\n];\n\n// Shake with a custom speed and direction\n[self.textField shake:10   // 10 times\n            withDelta:5    // 5 points wide\n                speed:0.03 // 30ms per shake\n       shakeDirection:ShakeDirectionVertical\n];\n```\n\n### In Swift\n\n```swift\n// Shake\nself.textField.shake()\n\n// Shake with the default speed\nself.textField.shake(10,              // 10 times\n                     withDelta: 5.0   // 5 points wide\n)\n\n// Shake with a custom speed\nself.textField.shake(10,              // 10 times\n                     withDelta: 5.0,  // 5 points wide\n                     speed: 0.03      // 30ms per shake\n)\n\n// Shake with a custom speed and direction\nself.textField.shake(10,              // 10 times\n                     withDelta: 5.0,  // 5 points wide\n                     speed: 0.03,     // 30ms per shake\n                     shakeDirection: ShakeDirection.Vertical\n)\n```\n\n## Completion Handler\nYou can also pass a completion block that will be performed as soon as the shake animation stops\n```objc\n- (void)shake:(int)times withDelta:(CGFloat)delta completion:(void((^)()))handler;\n- (void)shake:(int)times withDelta:(CGFloat)delta speed:(NSTimeInterval)interval completion:(void((^)()))handler;\n- (void)shake:(int)times withDelta:(CGFloat)delta speed:(NSTimeInterval)interval shakeDirection:(ShakeDirection)shakeDirection completion:(void((^)()))handler;\n```\nor in Swift using the trailing closure syntax:\n```swift\ntextField.shake(10, withDelta: 5) {\n    println(\"done\")\n}\n```\n\n# Author\n[Andrea Mazzini](https://twitter.com/theandreamazz). I'm available for freelance work, feel free to contact me.\n\nWant to support the development of [these free libraries](https://cocoapods.org/owners/734)? Buy me a coffee ☕️ via [Paypal](https://www.paypal.me/andreamazzini).  \n\n# Contributors\nThanks to [everyone](https://github.com/andreamazz/UITextField-Shake/graphs/contributors) kind enough to submit a pull request.\n\n# MIT License\n\tCopyright (c) 2017 Andrea Mazzini. All rights reserved.\n\n\tPermission is hereby granted, free of charge, to any person obtaining a\n\tcopy of this software and associated documentation files (the \"Software\"),\n\tto deal in the Software without restriction, including\n\twithout limitation the rights to use, copy, modify, merge, publish,\n\tdistribute, sublicense, and/or sell copies of the Software, and to\n\tpermit persons to whom the Software is furnished to do so, subject to\n\tthe following conditions:\n\n\tThe above copyright notice and this permission notice shall be included\n\tin all copies or substantial portions of the Software.\n\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\tOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\tMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n\tIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n\tCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n\tTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n\tSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":["https://www.paypal.me/andreamazzini"],"categories":["UI","Animation","Objective-C"],"sub_categories":["TextField \u0026 TextView","Layout","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreamazz%2FUITextField-Shake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreamazz%2FUITextField-Shake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreamazz%2FUITextField-Shake/lists"}