- August 28, 2025
- Mins Read
UITextField category that adds a shake animation like the password field of the OsX login screen.

pod ‘UITextField+Shake’, ‘~> 1.2’
Import UITextField+Shake.h in your controller’s header file, or UITextField_Shake if you are using the use_frameworks! directive.
github “andreamazz/UITextField-Shake”
// Shake
[[self.textField] shake];
// Shake with the default speed
[self.textField shake:10 // 10 times
withDelta:5 // 5 points wide
];
// Shake with a custom speed
[self.textField shake:10 // 10 times
withDelta:5 // 5 points wide
speed:0.03 // 30ms per shake
];
// Shake with a custom speed and direction
[self.textField shake:10 // 10 times
withDelta:5 // 5 points wide
speed:0.03 // 30ms per shake
shakeDirection:ShakeDirectionVertical
];
// Shake
self.textField.shake()
// Shake with the default speed
self.textField.shake(10, // 10 times
withDelta: 5.0 // 5 points wide
)
// Shake with a custom speed
self.textField.shake(10, // 10 times
withDelta: 5.0, // 5 points wide
speed: 0.03 // 30ms per shake
)
// Shake with a custom speed and direction
self.textField.shake(10, // 10 times
withDelta: 5.0, // 5 points wide
speed: 0.03, // 30ms per shake
shakeDirection: ShakeDirection.Vertical
)
You can also pass a completion block that will be performed as soon as the shake animation stops
– (void)shake:(int)times withDelta:(CGFloat)delta completion:(void((^)()))handler;
– (void)shake:(int)times withDelta:(CGFloat)delta speed:(NSTimeInterval)interval completion:(void((^)()))handler;
– (void)shake:(int)times withDelta:(CGFloat)delta speed:(NSTimeInterval)interval shakeDirection:(ShakeDirection)shakeDirection completion:(void((^)()))handler;
or in Swift using the trailing closure syntax:
textField.shake(10, withDelta: 5) {
println(“done”)
}
This package provides you with an easy way to show tooltips over any SwiftUI view, since Apple does not provide ...
SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or ...
Create Toast Views with Minimal Effort in SwiftUI Using SSToastMessage. SSToastMessage enables you to effortlessly add toast notifications, alerts, and ...