jaggi
jaggi

Reputation: 19

iPhone - sending an action from one UIViewController to another?

I have a login view controller that appears only if a user is not logged-in.

After being logged-in, the view is removed.

My question: how would I send an action to the view controller that requested the login view?

Upvotes: 0

Views: 334

Answers (1)

Joe
Joe

Reputation: 57169

You may want to consider delegation or a target-action approach. In the end you will give the login view some information about your view controller so that it will be notified once login is complete.

Ex.

//Your view controller
loginView.delegate = self;

...

//loginView code
-(void)loginComplete
{
    [self.delegate loginComplete:self];
}

Upvotes: 1

Related Questions