2
votes

I have a UITabBarController with five tab bar items, one of them is share button action (to share the itunes store link - tell a friend). My issue is when I click on this tab, the UIActivityViewController has displayed with blank controller, I need to show the share window (UIActivityViewController) to appear above the last tab bar view selected to avoid the blank view of this tab bar item.

1
@Fatima , Are you logged in your device, those account where you want to share the (Like whats app,Facebook etc). Or you are test it on simulator?Parvendra Singh
@ParvendraSingh Of course I am testing on device, the share action works but I want it to appear above the last tab viewFatima

1 Answers

1
votes

You can implement the UITabBarControllerDelegate protocol and use the - tabBarController:shouldSelectViewController: method to intercept the tap on the share tab like this:

- (BOOL) tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {
    if (viewController == [tabBarController.viewControllers objectAtIndex:/*share button index*/]){
        //show UIActivityViewController
        return NO;
    }
    return YES;
}