美文网首页
自动消失的提示框

自动消失的提示框

作者: Cy_Star | 来源:发表于2018-01-09 10:07 被阅读38次
    UIAlertController * alert = [UIAlertController alertControllerWithTitle:string message:nil preferredStyle:UIAlertControllerStyleAlert];
    [self presentViewController:alert animated:NO completion:nil];
    [NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector:@selector(creatAlert:) userInfo:alert repeats:NO];
    
    
    - (void)creatAlert:(NSTimer *)timer{
    UIAlertController *alert = [timer userInfo];
    [alert dismissViewControllerAnimated:YES completion:nil];
    alert = nil;
    }

    相关文章

      网友评论

          本文标题:自动消失的提示框

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