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