When developing iOS, it was found that when jumping from one viewcontroller to another viewcontroller, the return button of the Viewcontroller that was jumped to is always the title of the previous Viewcontroller. If the title of the last Viewcontroller more words will appear the interface is messy, so I want to achieve is the return button only show "back."
Development environment:
Ios:10
Xcode:8
Returns the display logic for a button
To know how to achieve the function you want first to grasp the relevant theoretical knowledge, the following examples illustrate.
If you jump from viewcontroller:a to B, then the display of the return button for B follows the following guidelines:
1. If a defines backbarbuttonitem, then B displays the backbarbuttonitem of a definition;
2. If b defines Leftbarbuttonitem, then B will display its own leftbarbuttonitem;
3. If a is undefined backbarbuttonitem,b also does not define Leftbarbuttonitem, then B displays the system default return button.
Implementing the Return button shows only "Back"
From the theory in the previous section, we can see that the principle of "1" can reach what I want to define Backbarbuttonitem in a:
Add the following statement to the Viewdidload method of a
" Back ", Style:. Plain, Target:nil, action:nil);
iOS let the back button show the custom title instead of the last Viewcontroller title