Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. // in firstVC
  2. -prepareForSegue:sender:
  3. {
  4. VC *destination = segue.destination;
  5. self.flow.setupFlowBlock(destination);
  6. }
  7.  
  8. // in flow
  9. typedef FlowBlock = ^void (VC *destination);
  10. @property (copy, nonatomic) setupFlowBlock;
  11.  
  12. - (void)showSecondVC:(VM *)sender sender:(id)sender
  13. {
  14. [currentVC performSegueWithIdentifier:@"secondVCSegueName" sender:sender]
  15. self.setupFlowBlock = ^(VC *destination) {
  16. destination.viewModeller = ({
  17. SecondVM *secondVM = [SecondVM new];
  18. secondVM.routing = sender.routing;
  19. secondVM.dataModel = sender.secondDataModel;
  20. self.currentVC = destination;
  21. });
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement