UITextField category that adds a shake animation like the password field of the OsX login screen.
Screenshot
Setup with Cocoapods
- Add 
pod 'UITextField+Shake' to your Podfile 
- Run 
pod install
 
- Run 
open App.xcworkspace
 
- Import 
UITextField+Shake.h in your controller's header file 
Usage
// 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
             andSpeed:0.03 // 30ms per shake
];
// Shake with a custom speed and direction
[self.textField shake:10   // 10 times
            withDelta:5    // 5 points wide
             andSpeed:0.03 // 30ms per shake
       shakeDirection:ShakeDirectionVertical
];
 
Download: https://github.com/andreamazz/UITextField-Shake/archive/master.zip
 
No comments:
Post a Comment