CustomIOSAlertView

//做版本更新提示器
//提示框
- (void)showAlertViewWithString:(NSString *)string {

      CustomIOSAlertView *alertView = [[CustomIOSAlertView alloc] initWithParentView:SharedApplication.keyWindow];
      [alertView setContainerView:[self createMessageView:string]];
      [alertView setButtonTitles:[NSMutableArray arrayWithObjects:@"立即更新", @"以后再说", nil]];
      [alertView setDelegate:self];
      [alertView setOnButtonTouchUpInside:^(CustomIOSAlertView *alertView, int buttonIndex) {
      [alertView close];
      }];
      [alertView setUseMotionEffects:true];
      [alertView show];
}

//协议方法
#pragma mark --CustomIOSAlertViewDelegate
- (void)customIOS7dialogButtonTouchUpInside: (CustomIOSAlertView *)alertView clickedButtonAtIndex: (NSInteger)buttonIndex
{
if (buttonIndex == 0) {
NSString *url = @"https://itunes.apple.com/cn/app/shan-xi-gua-hao/id992049985?mt=8";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}
[alertView close];
}

你可能感兴趣的:(CustomIOSAlertView)