ShortenedURLExpander
Shortened URL Expander
Cocoapods
Add the following to your project's Podfile:
pod 'ShortenedURLExpander'
Carthage
Add the following to your project's Cartfile:
github "retriable/ShortenedURLExpander"
Example
self.expander=[[ShortenedURLExpander alloc] initWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] isURLShortened:^bool(NSURL *url) {
return [url.host isEqualToString:@"t.cn"];
}];
self.operation=[self.expander expand:[NSURL URLWithString:@"http://t.cn/RnWLQVx"] maximumRetries:2 completion:^(NSURL *originalUrl,NSURL *expandedUrl, NSError *error) {
NSLog(@"%@",expandedUrl);
}];