美文网首页
CustomIOSAlertView

CustomIOSAlertView

作者: 郭鵬飛on | 来源:发表于2016-07-01 17:32 被阅读941次

    //做版本更新提示器
    //提示框
    - (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

          本文链接:https://www.haomeiwen.com/subject/dbzfjttx.html