Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <a class="btn btn-default btn-block btn-lg" href="out:http://www.mini-zambesiauto.co.za/contact.html">MINI Legends @ Zambesi</a>
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
- NSString *URLString = [[request URL] absoluteString];
- URLString = [URLString stringByRemovingPercentEncoding];
- if ([[URLString substringToIndex:4] isEqualToString:@"out:"]) {
- if (navigationType == UIWebViewNavigationTypeLinkClicked ) {
- NSString *savedURL = [URLString substringFromIndex:4];
- NSURL *finalURL = [NSURL URLWithString:savedURL];
- UIApplication *application = [UIApplication sharedApplication];
- [application openURL:finalURL options:@{} completionHandler:nil];
- return NO;
- }
- return YES
- }
- (IBAction)shareButton:(UIBarButtonItem *)sender
- {
- NSString *textToShare = @"Look at this awesome website for aspiring iOS Developers!";
- NSURL *myWebsite = [NSURL URLWithString:@"http://www.codingexplorer.com/"];
- NSArray *objectsToShare = @[textToShare, myWebsite];
- UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:objectsToShare applicationActivities:nil];
- NSArray *excludeActivities = @[UIActivityTypeAirDrop,
- UIActivityTypePrint,
- UIActivityTypeAssignToContact,
- UIActivityTypeSaveToCameraRoll,
- UIActivityTypeAddToReadingList,
- UIActivityTypePostToFlickr,
- UIActivityTypePostToVimeo];
- activityVC.excludedActivityTypes = excludeActivities;
- [self presentViewController:activityVC animated:YES completion:nil];
- }
Add Comment
Please, Sign In to add comment