Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. + (void)showOnViewController:(UIViewController*)parentVC completion:(MYVCCompletionBlock)completion
  2. {
  3. MYVC *notificationsViewController
  4. = [parentVC.storyboard instantiateViewControllerWithIdentifier:NSStringFromClass(self)];
  5. notificationViewController.completion = completion
  6.  
  7. [notificationsViewController willMoveToParentViewController:parentVC];
  8. [notificationsViewController viewWillAppear:YES];
  9.  
  10. // настраиваешь иерархию вью
  11. // в случае, если откуда угодно - я бы добавлял к window
  12.  
  13. [UIView animateWithDuration:
  14. animations:
  15. completion:^(BOOL finished)
  16. {
  17. [notificationsViewController viewDidAppear:YES];
  18. [parentVC addChildViewController:self];
  19. [notificationsViewController didMoveToParentViewController:parentVC];
  20. }];
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement