wimagguc / ios-custom-alertview

Custom UIAlertView. Continue adding images and UIViews to dialogs in iOS7+
Other
1.66k stars 394 forks source link

impossible to add variable label (IBOutlet) in containerview before [show] #108

Open JoeriBultheel opened 7 years ago

JoeriBultheel commented 7 years ago

Hi,

I'm using a xib file as the containerView for the CustomIOSAlertView. It has an IBOutlet UILabel of which I want to set the text before showing the AlertView. Thusfar I cannot get it to work: The view doesn't recognize the selector setLabelText: I think because the -awakeFromNib is never called ?

Is there an example of this working somewhere? how could I achieve this? code:

ConfirmEmailAlertView *emailAlertView = [[ConfirmEmailAlertView alloc] init];
emailAlertView.layer.cornerRadius = 7;
emailAlertView.layer.masksToBounds = YES;
[emailAlertView setEmailtext:self.txtEmail.text];
CustomIOSAlertView *emailAlert = [[CustomIOSAlertView alloc] init];
[emailAlert setContainerView: emailAlert];
emailAlert.alpha = 0.95;
[emailAlert setButtonTitles:[NSMutableArray arrayWithObjects:@"NO", @"YES", nil]];
[emailAlert setDelegate:self];

[emailAlert show];

THNX !