Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //dialog name - "Custom Center Popup"
- [Leanplum defineAction:Custom_Center_Popup
- ofKind:kLeanplumActionKindMessage | kLeanplumActionKindAction
- withArguments:@[
- [LPActionArg argNamed:@"Title" withString:@"Custom Title"],
- [LPActionArg argNamed:@"Message" withString:@"Custom Text goes here..."],
- [LPActionArg argNamed:@"Title.Color" withColor:[UIColor colorWithRed:(251/255.0) green:(199/255.0) blue:(0/255.0) alpha:1]],
- [LPActionArg argNamed:@"Message.Color" withColor:[UIColor colorWithRed:(255/255.0) green:(255/255.0) blue:(255/255.0) alpha:1]],
- [LPActionArg argNamed:@"First button.Text" withString:@"Contact Us"],
- [LPActionArg argNamed:@"First button.Text color" withColor:[UIColor colorWithRed:(0/255.0) green:(0/255.0) blue:(0/255.0) alpha:1]],
- [LPActionArg argNamed:@"First button.Background color" withColor:[UIColor colorWithRed:(251/255.0) green:(199/255.0) blue:(0/255.0) alpha:1]],
- [LPActionArg argNamed:@"Second button.Text" withString:@"More"],
- [LPActionArg argNamed:@"Second button.Text color" withColor:[UIColor colorWithRed:(251/255.0) green:(199/255.0) blue:(0/255.0) alpha:1]],
- [LPActionArg argNamed:@"Second button.Background color" withColor:[UIColor colorWithRed:(251/255.0) green:(199/255.0) blue:(0/255.0) alpha:1]],
- [LPActionArg argNamed:@"Background color" withColor:[UIColor colorWithRed:(0/255.0) green:(0/255.0) blue:(0/255.0) alpha:1]],
- ]
- withResponder:^BOOL(LPActionContext *context) {
- @try
- {
- self.couponMissing = [GYGNoCouponViewController new];
- self.couponMissing.view.frame = [[UIScreen mainScreen] bounds];
- self.couponMissing.view.x = 0;
- self.couponMissing.view.y = 0;
- [self.couponMissing.view layoutIfNeeded];
- KLCPopup * popup = [KLCPopup popupWithContentView:self.couponMissing.view showType:KLCPopupShowTypeBounceIn dismissType:KLCPopupDismissTypeBounceOut maskType:KLCPopupMaskTypeDimmed dismissOnBackgroundTouch:YES dismissOnContentTouch:NO];
- [popup show];
- self.couponMissing.popup = popup;
- self.couponMissing.lblTitle.text = [context stringNamed:@"Title"];
- self.couponMissing.lblTitle.textColor = [context colorNamed:@"Title.Color"];
- self.couponMissing.lblDescription.text = [context stringNamed:@"Message"];
- self.couponMissing.lblDescription.textColor = [context colorNamed:@"Message.Color"];
- [self.couponMissing.btnContactUs setTitle:[context stringNamed:@"First button.Text"] forState:UIControlStateNormal];
- self.couponMissing.btnContactUs.titleLabel.textColor = [context colorNamed:@"First button.Text color"];
- [self.couponMissing.btnContactUs setBackgroundColor:[context colorNamed:@"First button.Background color"]];
- [self.couponMissing.btnMore setTitle:[context stringNamed:@"Second button.Text"] forState:UIControlStateNormal];
- self.couponMissing.btnMore.titleLabel.textColor = [context colorNamed:@"Second button.Text color"];
- [self.couponMissing.btnMore setBackgroundColor:[context colorNamed:@"Second button.Background color"]];
- self.couponMissing.containerView.backgroundColor = [context colorNamed:@"Background color"];
- [self->_contexts addObject:context];
- return YES;
- }
- @catch (NSException *exception) {
- LOG_LP_MESSAGE_EXCEPTION;
- return NO;
- }
- }
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement