- July 11, 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”)
}
A SwiftUI View that emits confetti with user-defined shapes, images, and text.
A colour wheel made all in SwiftUI. There are 2 different colour wheels to choose from. The first main one ...
A color picker implementation with color wheel appearance written in plain SwiftUI. It is compatible with UIColor and NSColor.
This repository is no longer maintained. Here's why: with the release of iOS 16 SwiftUI now enables most of the ...