Let's talk about the idea first:
First, create two view controllers, create a label and a button in the first view controller, where the label is to display the string passed by the second view controller.
The button is to push to the second interface.
The second interface creates only one TextField, which is for entering text, and when the text is entered and the first interface is returned (the second view is going to disappear), the
The text in the textfiled is passed to the first interface and is displayed on the label.
Let's look at the specific code implementation process:
1. Instantiate the label and Button as well as the TextField process here I will not elaborate, I first go to the corresponding interface to create these three control keys
2. We want to use the block to pass the value, in the second view controller's. h file defines the attribute that declares the block
3. Implementing a method in the second view controller
4. Get the second view controller in the first view and invoke the defined properties with the second view controller
All right! This completes the block pass value! Ha ha...
Ios-block Two interface transfer values