Advertisement
lvs

share vk

lvs
Feb 28th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void) showShareDialog {
  2.     VKLOG(@"showShareDialog");
  3.     VKShareDialogController * shareDialog = [VKShareDialogController new]; //1
  4.     shareDialog.text = @"This post created using #vksdk #ios"; //2
  5.     shareDialog.vkImages = @[@"-10889156_348122347",@"7840938_319411365",@"-60479154_333497085"]; //3
  6.     shareDialog.shareLink = [[VKShareLink alloc] initWithTitle:@"Super puper link, but nobody knows" link:[NSURL URLWithString:@"https://vk.com/dev/ios_sdk"]]; //4
  7.     [shareDialog setCompletionHandler:^(VKShareDialogControllerResult result) {
  8.         [shareDialog dismissViewControllerAnimated:YES completion:nil];
  9.     }]; //5
  10.     [self presentViewController:shareDialog]; //6
  11. }
  12.  
  13. -(void) presentViewController:(UIViewController*)controller {
  14.     VKLOG(@"presentViewController");
  15.     UINavigationController *navigation =
  16.     [[[UINavigationController alloc] initWithRootViewController:controller] autorelease];
  17.     if(VK_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) {
  18.         navigation.navigationBar.barTintColor = VK_COLOR;
  19.         navigation.navigationBar.tintColor = [UIColor whiteColor];
  20.         navigation.navigationBar.translucent = YES;
  21.     }
  22.    
  23.     UIApplication * application = [UIApplication sharedApplication];
  24.     UIViewController* rootVC = application.keyWindow.rootViewController;
  25.     [rootVC presentViewController:navigation animated:YES completion:nil];
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement