I have got two UIViewController:
- MainVC
- PickerVC
In main view controller I have IBAction method: - showPickerView
In this method I need to create block that will present PickerVC view and wait me while I choose something value on PickerVC view and press Done button.
In this block I need to implement callback that will invoke method in MainVC after I press on button Done.
So, I have used block before, but I don't know how to implement it by myself.
I think first part will be look like this:
- (IBAction)showPickerView {
__block PickerVC *pickerVC = [[PickerVC alloc] init];
[pickerVC setFinishBlock:^{
// Do something after user press on Done button
}];
[pickerVC setFailedBlock:^{
// Do something if something wrong (but this method optional)
}];
[pickerVC showPicker];
}
NSNotificationCenter...?