self
.
alert
=[[
UIAlertView
alloc
]
initWithTitle
:
@"
您已通过审核
"
message
:
@"
恭喜您已通过经济人审核
,
请返回主页实现梦想
"
delegate
:
self
cancelButtonTitle
:
@"
取消
"
otherButtonTitles
:
@"
确认
"
,
nil
];
[[ NSUserDefaults standardUserDefaults ] setObject : @"1" forKey : @"messageCount" ];
[[ NSUserDefaults standardUserDefaults ] synchronize ];
self . alert . delegate = self ;
self . alert . tag = 500 ;
[ self . alert show ];
//alert 系统提示关闭
UITapGestureRecognizer *recognizerTap = [[ UITapGestureRecognizer alloc ] initWithTarget : self action : @selector (handleTapBehind:)];
[recognizerTap setNumberOfTapsRequired : 1 ];
recognizerTap. cancelsTouchesInView = NO ;
[[ NSUserDefaults standardUserDefaults ] setObject : @"1" forKey : @"messageCount" ];
[[ NSUserDefaults standardUserDefaults ] synchronize ];
self . alert . delegate = self ;
self . alert . tag = 500 ;
[ self . alert show ];
//alert 系统提示关闭
UITapGestureRecognizer *recognizerTap = [[ UITapGestureRecognizer alloc ] initWithTarget : self action : @selector (handleTapBehind:)];
[recognizerTap setNumberOfTapsRequired : 1 ];
recognizerTap. cancelsTouchesInView = NO ;
[[UIApplication sharedApplication].keyWindow addGestureRecognizer:recognizerTap];
//alert
系统提示关闭
- ( void )handleTapBehind:( UITapGestureRecognizer *)sender {
if (sender. state == UIGestureRecognizerStateEnded ){
CGPoint location = [sender locationInView : nil ];
if (![ self . alert pointInside :[ self . alert convertPoint :location fromView : self . alert . window ] withEvent : nil ]){
[ self . alert . window removeGestureRecognizer :sender];
[ self . alert dismissWithClickedButtonIndex : 0 animated : YES ];
}
}
- ( void )handleTapBehind:( UITapGestureRecognizer *)sender {
if (sender. state == UIGestureRecognizerStateEnded ){
CGPoint location = [sender locationInView : nil ];
if (![ self . alert pointInside :[ self . alert convertPoint :location fromView : self . alert . window ] withEvent : nil ]){
[ self . alert . window removeGestureRecognizer :sender];
[ self . alert dismissWithClickedButtonIndex : 0 animated : YES ];
}
}
}