Git Product home page Git Product logo

shakingalertview's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

shakingalertview's Issues

Test not testing the right thing

I just read through the Kiwi tests and stumbled across line 287.

https://github.com/stringer630/ShakingAlertView/blob/master/Example%20Project/ShakingAlertViewKiwiTest/ShakingAlertViewTests.m#L287

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

onCorrectPassword block called twice

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;
    }

}

Renamed block properties

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?

Incorrect SHA1 hash value

Not hashing string to expected value, that is a value computed by another SHA1 system, such as OpenSSL.

Can not used in IOS 7

ShakingAlertView can not used in IOS 7. When user click ok, the dialog closed and nothing happen.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.