Disable button not working

I am new to iOS app development and recently I was making a simple login app whose interface looks like this:


http://imgur.com/W3nxMEG


I just want the Login button to take me to the next ViewController only when:

1) All fields are filled

2) Passwords match


I created a pointer modButton that is hooked with the Login butotn in the storyboard. I disabled it in the loginButton action method but it doesnt seem to work.


link to my code: imgur.com/01Y6X6U


Anybody willing to help me solve this issue?


Regards

Well, 22 views and not even a single reply. Ah this is annoying.

I know this is an old thread (probably long delayed moderation) but the general idea is (assuming you're using a segue) to define the segue from the source view controller to the destination, *not* from the button. Then in your button IBAction you can do your checks and call performSegueWithIdentifier iff all your checks pass.


If you define the segue from the button, your segue is going to happen and there's nothing you can do about it. (Well maybe you could define some flag property and then somehow abort it in prepareForSegue, but it's much cleaner to just initiate the segue yourself only if your conditions are met.)

Disable button not working
 
 
Q