Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.27 KB | None | 0 0
  1. //dialog name - "Custom Center Popup"
  2.  
  3. [Leanplum defineAction:Custom_Center_Popup
  4. ofKind:kLeanplumActionKindMessage | kLeanplumActionKindAction
  5. withArguments:@[
  6. [LPActionArg argNamed:@"Title" withString:@"Custom Title"],
  7. [LPActionArg argNamed:@"Message" withString:@"Custom Text goes here..."],
  8.  
  9. [LPActionArg argNamed:@"Title.Color" withColor:[UIColor colorWithRed:(251/255.0) green:(199/255.0) blue:(0/255.0) alpha:1]],
  10. [LPActionArg argNamed:@"Message.Color" withColor:[UIColor colorWithRed:(255/255.0) green:(255/255.0) blue:(255/255.0) alpha:1]],
  11.  
  12. [LPActionArg argNamed:@"First button.Text" withString:@"Contact Us"],
  13. [LPActionArg argNamed:@"First button.Text color" withColor:[UIColor colorWithRed:(0/255.0) green:(0/255.0) blue:(0/255.0) alpha:1]],
  14. [LPActionArg argNamed:@"First button.Background color" withColor:[UIColor colorWithRed:(251/255.0) green:(199/255.0) blue:(0/255.0) alpha:1]],
  15.  
  16. [LPActionArg argNamed:@"Second button.Text" withString:@"More"],
  17. [LPActionArg argNamed:@"Second button.Text color" withColor:[UIColor colorWithRed:(251/255.0) green:(199/255.0) blue:(0/255.0) alpha:1]],
  18. [LPActionArg argNamed:@"Second button.Background color" withColor:[UIColor colorWithRed:(251/255.0) green:(199/255.0) blue:(0/255.0) alpha:1]],
  19.  
  20. [LPActionArg argNamed:@"Background color" withColor:[UIColor colorWithRed:(0/255.0) green:(0/255.0) blue:(0/255.0) alpha:1]],
  21. ]
  22. withResponder:^BOOL(LPActionContext *context) {
  23. @try
  24. {
  25. self.couponMissing = [GYGNoCouponViewController new];
  26. self.couponMissing.view.frame = [[UIScreen mainScreen] bounds];
  27. self.couponMissing.view.x = 0;
  28. self.couponMissing.view.y = 0;
  29. [self.couponMissing.view layoutIfNeeded];
  30.  
  31. KLCPopup * popup = [KLCPopup popupWithContentView:self.couponMissing.view showType:KLCPopupShowTypeBounceIn dismissType:KLCPopupDismissTypeBounceOut maskType:KLCPopupMaskTypeDimmed dismissOnBackgroundTouch:YES dismissOnContentTouch:NO];
  32.  
  33. [popup show];
  34.  
  35. self.couponMissing.popup = popup;
  36. self.couponMissing.lblTitle.text = [context stringNamed:@"Title"];
  37. self.couponMissing.lblTitle.textColor = [context colorNamed:@"Title.Color"];
  38.  
  39. self.couponMissing.lblDescription.text = [context stringNamed:@"Message"];
  40. self.couponMissing.lblDescription.textColor = [context colorNamed:@"Message.Color"];
  41.  
  42. [self.couponMissing.btnContactUs setTitle:[context stringNamed:@"First button.Text"] forState:UIControlStateNormal];
  43. self.couponMissing.btnContactUs.titleLabel.textColor = [context colorNamed:@"First button.Text color"];
  44. [self.couponMissing.btnContactUs setBackgroundColor:[context colorNamed:@"First button.Background color"]];
  45.  
  46. [self.couponMissing.btnMore setTitle:[context stringNamed:@"Second button.Text"] forState:UIControlStateNormal];
  47. self.couponMissing.btnMore.titleLabel.textColor = [context colorNamed:@"Second button.Text color"];
  48. [self.couponMissing.btnMore setBackgroundColor:[context colorNamed:@"Second button.Background color"]];
  49.  
  50. self.couponMissing.containerView.backgroundColor = [context colorNamed:@"Background color"];
  51.  
  52.  
  53. [self->_contexts addObject:context];
  54. return YES;
  55. }
  56. @catch (NSException *exception) {
  57. LOG_LP_MESSAGE_EXCEPTION;
  58. return NO;
  59. }
  60. }
  61. ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement