0

How I can deal with UIActionSheet and three20?

I am following this tutorial.

I know about displaying a single photo by clicking on one from the thumbnail viewer is provided to you for free by Three20. In addition, the library also provides all of the native functions such as pinch-to-zoom, swiping to navigate and tapping to hide/show the navigation arrows and back button.

I want to add a button that if clicked by the user, would display a UIActionSheet with options for sharing the photo by mail or MMS and save( using UIImageWriteToSavedPhotosAlbum )and the user would choose one of them.

I see a lot of tutorials about this but I need to do this by my self.

rain
  • 1
  • 1
  • 3

1 Answers1

0

in .h file add

UIActionSheet *actionViewPopup;

in .m file

actionViewPopup = [[UIActionSheet alloc] initWithTitle:nil
                                                  delegate:self
                                         cancelButtonTitle:@"Cancel"
                                    destructiveButtonTitle:nil
                                         otherButtonTitles:@"email",@"sms",nil];

[actionViewPopup showInView:self.parentViewController.tabBarController.view];   

CODE FOR HANDLING CLICK OF ACTIONSHEET

-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
    //THIS METHOD SHOWS WHICH BUTTON FROM ACTION SHEET IS PRESSED
    if (buttonIndex == 0) 
    {
        NSLog(@"email clicked");
        //do code for email (mail composer)

    }
    if (buttonIndex == 1) 
    {
        NSLog(@"sms clicked");
       //do code for sms 

    }

}
Rahul Chavan
  • 480
  • 3
  • 6
  • ok but i want to add button in a single photo view how can do that? the single photo view is ordy created by three20 what is the class for single photo view thx – rain Nov 30 '11 at 11:24