Skip to content

Instantly share code, notes, and snippets.

@ldenoue
Created May 9, 2016 13:30
Show Gist options
  • Save ldenoue/b234b3872117341964fd7f568e16e658 to your computer and use it in GitHub Desktop.
Save ldenoue/b234b3872117341964fd7f568e16e658 to your computer and use it in GitHub Desktop.
openURL from Action Extension in iOS without using [UIApplication sharedApplication]
UIResponder *responder = self;
while(responder){
if ([responder respondsToSelector: @selector(OpenURL:)]){
[responder performSelector: @selector(OpenURL:) withObject: [NSURL URLWithString:url]];
}
responder = [responder nextResponder];
}
@NSExceptional
Copy link

Would NSClassFromString + performSelector:withObject: not do the trick?
And if not that there's always objc_msgSend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment