1. 程式人生 > >iOS防止使用者截圖

iOS防止使用者截圖

-(void)jiePing

{

UIAlertView *alertView=[[UIAlertViewalloc]initWithTitle:nilmessage:@"[安全提醒]內含付款碼,只適合當面使用。不要截圖或分享給他人以保障資金安全。"delegate:selfcancelButtonTitle:@"絕不給別人"otherButtonTitles:@"僅我自己用",nil];

    alertView.tag=105;

    [alertView show];

}

//這種寫法會導致整個程式任何一個介面截圖都會有彈出提示框,因為根本就沒有指定哪個控制器,而且是一直在主執行緒裡面