Skip to content

Instantly share code, notes, and snippets.

@volodg
Created December 4, 2012 14:37
Show Gist options
  • Save volodg/4204586 to your computer and use it in GitHub Desktop.
Save volodg/4204586 to your computer and use it in GitHub Desktop.
Best practices
//было
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"SegueFromRegistrationToCreateAccount"]) {
CreateAccountVC *vc = segue.destinationViewController;
__weak RegistrationFirstVC *weakSelf = self;
vc.onCompleteDialogBlock = ^(id result, NSError *error, BOOL isCanceled) {
[weakSelf.navigationController popViewControllerAnimated:NO];
[weakSelf makeTransitionAfterSimpleRegistrationWithProfile:result];
};
vc.facebookRegistrationUser = self.facebookRegistrationUser;
}
}
- (void)showRegitrationScreen
{
[self performSegueWithIdentifier:@"SegueFromRegistrationToCreateAccount"
sender:self];
}
//стало
- (void)showRegitrationScreen
{
JFFPerformSegueCallback callback = ^(UIStoryboardSegue *segue) {
CreateAccountVC *vc = segue.destinationViewController;
__weak RegistrationFirstVC *weakSelf = self;
vc.onCompleteDialogBlock = ^(id result, NSError *error, BOOL isCanceled) {
[weakSelf.navigationController popViewControllerAnimated:NO];
[weakSelf makeTransitionAfterSimpleRegistrationWithProfile:result];
};
vc.facebookRegistrationUser = self.facebookRegistrationUser;
};
[self performSegueWithIdentifier:@"SegueFromRegistrationToCreateAccount"
sender:self
callback:callback];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment