lukestringer90 / shakingalertview Goto Github PK
View Code? Open in Web Editor NEWUIAlertView subclass containing a password entry field and a 'shake' animation for incorrect password entry.
License: Other
UIAlertView subclass containing a password entry field and a 'shake' animation for incorrect password entry.
License: Other
I just read through the Kiwi tests and stumbled across line 287.
I guess thats a c&p error, but it seems you are not checking for the failurReached to be False. A few line to the top it sets failureReached = NO so it would always be NO?
Mind I didn´t actually run the code or tests, this is just from reading because I´m interested in testing with Kiwi :-)
Greetings
how to setting password at first time login or change password?
When tapping the OK button, onCorrectPassword is called twice:
[alertView dismissWithClickedButtonIndex:ShakingAlertViewButtonIndexSuccess animated:YES]; is called which calls [self safeCallBlock:self.self.onCorrectPassword];
alertView:clickedButtonAtIndex: calls the same completionblock afterwards.
Also: Any reason for calling self.self?
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
// If "Enter" button pressed on alert view then check password
if (buttonIndex == alertView.firstOtherButtonIndex) {
if ([self enteredTextIsCorrect]) {
// Hide keyboard
[self.passwordField resignFirstResponder];
// Dismiss with success
[alertView dismissWithClickedButtonIndex:ShakingAlertViewButtonIndexSuccess animated:YES];
[self safeCallBlock:self.self.onCorrectPassword];
}
// If incorrect then animate
else {
[self animateIncorrectPassword];
}
}
}
// Overide to customise when alert is dimsissed
- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated {
// Only dismiss for ShakingAlertViewButtonIndexDismiss or ShakingAlertViewButtonIndexSuccess
// This means we don't dissmis for the case where "Enter" button is pressed and password is incorrect
switch (buttonIndex) {
case ShakingAlertViewButtonIndexSuccess:
[super dismissWithClickedButtonIndex:ShakingAlertViewButtonIndexDismiss animated:animated];
[self safeCallBlock:self.self.onCorrectPassword];
break;
case ShakingAlertViewButtonIndexDismiss:
[super dismissWithClickedButtonIndex:ShakingAlertViewButtonIndexDismiss animated:animated];
[self safeCallBlock:self.onDismissalWithoutPassword];
break;
default:
break;
}
}
Is this the standard way of naming block properties:
@property (nonatomic, copy) void(^onCorrectPassword)();
@property (nonatomic, copy) void(^onDismissalWithoutPassword)();
Or should they be named something like:
@property (nonatomic, copy) void(^correctPasswordBlock)();
@property (nonatomic, copy) void(^dismissalWithoutPasswordBlock)();
Any Apple documentation on standard naming conventions?
Not hashing string to expected value, that is a value computed by another SHA1 system, such as OpenSSL.
ShakingAlertView can not used in IOS 7. When user click ok, the dialog closed and nothing happen.
No ARC version?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.