iOS page has a lot of values, the front has been sharing the value of the property and proxy value, today, mainly on the single-pass value and block value
Single-Case pass-through: a common pattern of development in a single case, because the object is the same object in the entire program whenever it is initialized, and the object has the same properties, so it can be used to pass values.
The block value is similar to the proxy value, which is mainly used for the second page to pass the value to the first page, and the block passes the specific steps:
On the second page:
1. Declaration: block typedef Void (^sendmessagerblock) (NSString *str);
2. Creation method:-(void) SendMessage: (sendmessagerblock) block;
3. Declaring properties: @property (nonatomic, copy) Sendmessagerblock block;
4. Implementation method:-(void) SendMessage: (Sendmessagerblock) block{
Self.block = Block;
}
5. Call Block:self.block (Self.textField.text);
On the first page
6. Calling method: [SECONVC sendmessage:^ (NSString *str) {
WeakSelf.textField.text = str;
}];
Single-pass value of the value of an IOS page, block pass value