the other answer works as expected.
create New File
, select Objective-C Class
- Class:
MyApplication
- Subclass of:
UIApplication
paste this code in the .m
file:
- (BOOL)openURL:(NSURL *)url {
if ([self handleOpenURL:url])
return YES;
else
return [super openURL:url];
}
- (BOOL)handleOpenURL:(NSURL*)url {
NSLog(@"my url handler");
return YES;
}
next open your main.m
and change the third parameter
return UIApplicationMain(argc, argv, nil, NSStringFromClass([SampleAppDelegate class]));
to your UIApplication
-subclass name
return UIApplicationMain(argc, argv, @"MyApplication", NSStringFromClass([SampleAppDelegate class]));