i have downloaded one nice sample code UAModalPanel. i have implemented it in my project, if we tap segment control’s first index it will open the UAModalPanel. i could successfully implemented this one.
But if we select second or third index in segment control i need to close the UAModalPanel How can i achieve this. if anyone knows guide me?

if we tap the segment control below will be called
-(void)navBarSegmentCntrl_tapped
{
if(navBarSegmentCntrl.selectedSegmentIndex==0)
{
UAExampleModalPanel *modalPanel = [[UAExampleModalPanel alloc] initWithFrame:self.view.bounds title:@"dfg" ];
[self.view addSubview:modalPanel];
// Show the panel from the center of the screen
[modalPanel showFromPoint:self.view.center];
}
else if(navBarSegmentCntrl.selectedSegmentIndex==1)
{
[UAmodal hide]; //UAmodal allocated in view didload//
imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.delegate = self;
imagePickerController.sourceType =
UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:imagePickerController animated:YES];
}
}
The problem is that the object that you are calling
showis not the same one your are callinghide. You should declare it in your interface file:And then, when you show it in
navBarSegmentCntrl_tappedmethod, you init thismyModalPanel(remember you don’t need to doUAModalPanel *myModalPanelagain, once you already set it up, and your view controller is “already aware of the object”. You just domyModalPanel = [[UAModalPanel alloc] init....).Then, to hide it, just call
[myModalPanel hide];.