Skip to content

Custom iOS alert view with a call to action button and callback handling

License

Notifications You must be signed in to change notification settings

afinello/UGDAlertView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UGDAlertView

CI Status Version License Platform

Usage

Use similar code in your ciew controller to show a custom call-to-action alert view over your controller content:

UGDAlertViewController* actionVC = [[UGDAlertViewController alloc] initWithTitle:@"Alert title" 
                                                                            text:@"Want to use custom alert view with call to action?" 
                                                                            icon:nil 
                                                                     actionTitle:@"Sure" 
                                                                        negative:@"No, thanks"];

[actionVC setMargin:UIEdgeInsetsMake(self.topLayoutGuide.length, 0, self.bottomLayoutGuide.length, 0)];

[actionVC showInViewController:self withCompletion:^(BOOL accepted) {
    // your code here
    // (accepted == YES) if user pressed the call to action button

    // remove alert view
    [actionVC hideAnimated:YES];
}];

Requirements

iOS 7 and later

Installation

UGDAlertView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "UGDAlertView"

Author

Afinello

License

UGDAlertView is available under the MIT license. See the LICENSE file for more info.

About

Custom iOS alert view with a call to action button and callback handling

Resources

License

Stars

Watchers

Forks

Packages

No packages published