Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. + (void)showOnViewController:(UIViewController*)parentVC
  2. {
  3.     WDDNotificationsViewController *notificationsViewController
  4.     = [parentVC.storyboard instantiateViewControllerWithIdentifier:NSStringFromClass(self)];
  5.     notificationsViewController.parentVC = parentVC;
  6.    
  7.     WYPopoverController *popoverController = [[WYPopoverController alloc] initWithContentViewController:notificationsViewController];
  8.     parentVC.notificationsPopover = popoverController;
  9.    
  10.     popoverController.theme.innerCornerRadius   = 0.0f;
  11.     popoverController.theme.outerCornerRadius   = 0.0f;
  12.     popoverController.theme.viewContentInsets   = UIEdgeInsetsZero;
  13.     popoverController.theme.borderWidth         = 3.0f;
  14.     popoverController.theme.arrowBase           = 24.0f;
  15.     popoverController.theme.arrowHeight         = 14.0f;
  16.     popoverController.theme.arrowBaseOffset     = 22.0f;
  17.     popoverController.theme.arrowHeightOffset   = 10.0f;
  18.     popoverController.theme.outerStrokeColor    = NOTIFICATIONS_GRAY_COLOR;
  19.     popoverController.theme.strokeWidth         = 1.25f;
  20.     popoverController.theme.fillTopColor        = [UIColor whiteColor];
  21.     popoverController.theme.fillBottomColor     = [UIColor whiteColor];
  22.    
  23.     popoverController.delegate                  = notificationsViewController;
  24.    
  25.     CGRect frame = parentVC.navigationItem.titleView.frame;
  26.     frame.size.height = frame.size.height - NOTIFICATIONS_BADGE_HEIGHT / 2 + 1;
  27.     [popoverController presentPopoverFromRect:frame
  28.                                        inView:parentVC.navigationItem.titleView.superview
  29.                      permittedArrowDirections:WYPopoverArrowDirectionUp
  30.                                      animated:YES];
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement