TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Unclaimed.
NLBURLAction is a library to open custom scheme URLs easily. It can convert URL to custom scheme URL.
Instance NLBURLAction
and register classes following NLBURLActionProtocol
.
NSURL *url = [NSURL URLWithString:@"https://twitter.com/agata/status/451892810430439424"];
NLBURLAction *urlAction = [[NLBURLAction alloc] initWithActionClasses:@[[NLBBacklogURLAction class], [NLBTwitterURLAction class], [NLBTweetbotURLAction class]]];
NSArray *actions = [urlAction arrayURLActionsWithURL:url];
NSLog(@"count=%d", actions.count); // 2
NSLog(@"actions[0]=%@", actions[0]); // NLBTwitterURLAction
NSLog(@"actions[1]=%@", actions[1]); // NLBTweetbotURLAction
NSObject<NLBURLActionProtocol> *action = (NSObject<NLBURLActionProtocol> *)actions[0];
[action doActionURL:url]; // open Tweeter app with URL