/*
判断此字符串中是否包含该正则表达式
*/
- (BOOL)match:(NSString *)expr str:(NSString *)str{
NSRegularExpression *exp = [NSRegularExpression regularExpressionWithPattern:expr options:0 error:nil];
return ([exp matchesInString:str options:0 range:NSMakeRange(0,str.length)].count > 0);
}
//是否包含正则匹配字段
-(BOOL)_handleOpenURL:(NSURL *)url{
NSString * urlStr = url.description;
if ([self match:@"^wb\\d+:" str:urlStr]) {
// return [self handleWeiboURL:url];
//
} if ([self match:@"^tencent\\d+:" str:urlStr]) {
}
return [self handleWeiXinURL:url];
}
用于解决 appDelegate里的都处分享,授权等 handleOpenURL:函数,openURL:函数回调的问题