M5ApplicationOpenURL 1.0.0

M5ApplicationOpenURL 1.0.0

测试已测试
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;
}];