测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可 | MIT |
发布最新发布 | 2015年3月 |
Maintained by Mathew Huusko V.
在 iOS 和 Mac 上响应对应用程序启动 URL 事件,无需拥有/弄脏应用程序代理。易于使用。解耦。
- (BOOL)applicationOpenURL:(NSURL *)URL fromApplication:(NSString *)sourceApplication {
NSLog(@"Opened via %@ from source application %@.", URL.absoluteString, sourceApplication);
if (/*some check against URL*/) {
return YES;
}
return NO;
}
...
[M5ApplicationOpenURL addHandlerWithTarget:self selector:@selector(applicationOpenURL:fromApplication:)];
//OR
[M5ApplicationOpenURL addHandlerWithCallback:^BOOL(NSURL *URL, NSString *sourceApplication) {
NSLog(@"Opened via %@ from source application %@.", URL.absoluteString, sourceApplication);
if (/*some check against URL*/) {
return YES;
}
return NO;
}];