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];
}];
iOS 7 and later
UGDAlertView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "UGDAlertView"
Afinello
UGDAlertView is available under the MIT license. See the LICENSE file for more info.