Developer
Developer

Reputation: 4321

Hide/Close ViewControllers

I have a Popover on my iPhone project:

popover screenshot

Which shows up, when I tap on a little picture:

-(void)tapDetected:(UITapGestureRecognizer *)sender
{
    UIImageView *iboImageView = sender.view;
    UITableView *tableView = (UITableView *)iboTableView;
    NSIndexPath *index = [NSIndexPath indexPathWithIndex:iboImageView.tag];
    MovieCell *cell = (MovieCell *)[tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:iboImageView.tag inSection:0]];
    [ApplicationManager getInstance].currentMovie=cell.nameLabel.text;

    DemoTableController *controller = [[DemoTableController alloc] initWithStyle:UITableViewStylePlain]; //This is my popover controller (what is displayed inside popover )
    FPPopoverController *popover = [[FPPopoverController alloc] initWithViewController:controller];
    popover.contentSize = CGSizeMake(150,158);
    [popover presentPopoverFromView:cell.iboPopImage];
}

When I press on a cell I want to collapse the popover. Is there something like self.close?

Upvotes: 0

Views: 94

Answers (1)

Sviatoslav Yakymiv
Sviatoslav Yakymiv

Reputation: 7935

From FPPopoverController.h file:

/** @brief Dismiss the popover **/
-(void)dismissPopoverAnimated:(BOOL)animated;

/** @brief Dismiss the popover with completion block for post-animation cleanup **/
typedef void (^FPPopoverCompletion)();
-(void)dismissPopoverAnimated:(BOOL)animated completion:(FPPopoverCompletion)completionBlock;

Use any of these methods to dismiss controller.

Upvotes: 3

Related Questions