[Address Book Case-Login Function-Segue Objective-C Language]

1. Let’s talk about the implementation of the login button next.

notify

1. Let’s implement a function of this login button.

For example, when I click "Login", I want to jump to the TableView at the back.

First, let’s take a look at the sample program for reference.

When our two text boxes above have values,

notify

When both text boxes have values, the login button will light up.

notify

When I click the "Login" button, I should jump to the controller at the back.

Okay, so what should we do at this time?

2. First, I need a controller. Let’s drag this controller out first.

Before dragging the controller, let's take a look at our sample program.

When I log in, a "Logging in" prompt message is displayed first.

notify

Then, show another controller,

notify

This is a TableViewController, right?

So, I drag another UITableViewController from behind.

notify

After dragging it,

notify

We now click the "Login" button and jump over.

Should we get connected?

Let's unplug it first,

notify

Select "show",

notify

For this connection, I should choose "show", right?

notify

So, below, there is an expired push.

Have you told everyone this? No, please tell everyone.

2.The difference between push and show

1) Actually, you choose push now, this time, command + R,

notify

There is no problem with this. The code is not expired, but the storyboard is expired.

notify

Okay, then, in this, I enter "1" in both text boxes.

notify

I now, let the "Login" button light up and then click,

notify

It can also be jumped over,

You select "show", in fact, it can also be skipped,

So, these two, "push", and "show",

What's the difference?

Here I am, inside this, delete it first,

notify

delete,

notify

Then, drag in a Controller casually.

notify

Okay, let’s use show to connect it first.

notify

Let's first, say, select "show",

Well, when selecting show, sometimes we may need to change the title of the controller behind you.

notify

So, what we just changed can be changed by double-clicking it.

Now, can't I change it by double-clicking it?

So what is the shortcoming at this time?

Do you want to drag something called "Navigation Item"?

Search for "navi"

notify

Okay, come on, inside here,

notify

Inside this, let's take a look. Inside this, tableViewController, there is only one table View.

notify

2) At this time, I want to drag a Navigation Item and bring it up.

notify

Hey, I can’t go up, oh, it’s the one on the right, ah,

notify

Okay, drag this "Navigation Item" up,

notify

Then, drag this thing up,

notify

After dragging it up,

notify

Now it's not just a table view,

notify

There is also something called "Navigation Item",

Then, here we can double-click to change the title.

notify

You can change its title.

notify

Then, command + R,

notify

Now, I also let it light up, and then click the "Login" button.

notify

It should display this title,

"·12312312", it also pushes from right to left.

Then, there will be a title of "·12312312",

3. Okay, so, what is the difference between push and show?

1) Now, I delete the previous Controller and drag another table View Controller.

notify

Then, connect a line to the login button,

notify

Select "push",

2) After selecting push, look here on the left.

notify

Look here on the left, there is a Navigation Item, right?

notify

After you choose push, is it equivalent to having this Navigation Item by default?

notify

You can also change the title,

notify

command + R,

I make the login button light up, click the login button,

notify

Click the login button,

notify

Is there a title above?

In other words, the difference between push and show is, in fact,

1) push: It will automatically add the previous Navigation Item to you.

Guess you like

Origin blog.csdn.net/madoca/article/details/135270691