NLBURLAction 0.1.6

NLBURLAction 0.1.6

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.



  • By
  • agata

NLBURLAction is a library to open custom scheme URLs easily. It can convert URL to custom scheme URL.

Screenshot

Used in Production

Requirements

  • iOS 4.3 or later
  • ARC

Usage

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

Supported Action

Open in app

Other actions

Install

License

MIT license.