Skip to content

cooler333/DCCustomPopup

Repository files navigation

#DCCustomPopup

Example

View without Popup

AFNetworking

Show Default Popup

AFNetworking

Show Popup with custom image

AFNetworking

Reference

Show popup without instance:

+ (void)customPopViewWithTitle:(NSString *)title message:(NSString *)message image:(UIImage *)image;

Custom init method:

- (DCCustomPopupView *)initWithTitle:(NSString *)title message:(NSString *)message image:(UIImage *)image;

Send this method to instance to show popup:

- (void)show;

delegate method:

- (void)customPopupView:(DCCustomPopupView *)popupView clickedButton:(UIButton *)button;

Example Usage

- (IBAction)showPopup:(id)sender {
    // Show Popup without init
    [DCCustomPopupView customPopViewWithTitle:titleTextField.text message:subtitleTextView.text image:nil];
}

- (IBAction)show:(id)sender {
    // create instance of DCCustomPopupView
    UIImage *image = [UIImage imageNamed:@"alert_no"]; // image: 50x50px || 100x100px(@2x)
    DCCustomPopupView *customPopupView = [[DCCustomPopupView alloc] initWithTitle:@"Title" message:@"Subtitle Subtitle Subtitle" image:image];
    [customPopupView setDelegate:self];
    [customPopupView setTag:1];
    [customPopupView show];
}

// Delegate method
- (void)customPopupView:(DCCustomPopupView *)popupView clickedButton:(UIButton *)button {
    if (popupView.tag == 1) {
        NSLog(@"Button was clicked");
    }
}

About

popup view for iPhone

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages