[英]How to dismiss a whole stack of view controllers in navigation view controller?
[英]Dismiss navigation controller and all of its view controllers stack in UIPopupview using a button within one of the views
我正在使用代碼顯示UIPopoverView:
selectClientPopController= [[UIPopoverController alloc]initWithContentViewController: [self.storyboard instantiateViewControllerWithIdentifier:@"navControllerMini"]];
selectClientPopController.popoverContentSize=CGSizeMake(500, 700);
selectClientPopController.delegate=self;
[selectClientPopController presentPopoverFromRect:CGRectMake(cell.frame.origin.x+120-scrollView.contentOffset.x, cell.frame.origin.y+120,cell.frame.size.width, cell.frame.size.height) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft | UIPopoverArrowDirectionRight animated:YES];
該導航視圖控制器用於逐步瀏覽兩個TableViewControllers,如下所示:
當按下最后一個tableView上的單元格時,我想關閉整個彈出窗口。 我知道這可能需要使用委托來完成,但是我不知道在何處分配委托以實現此目的。 謝謝您的幫助。
為什么不
// Listen for TableView row selection by setting up delegate.
// Basically self if you set the delegate in the same view controller
YourTableView.delegate = YourViewControllerObjectWhichHasTableView;
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[selectClientPopController dismissPopoverAnimated:YES];
}
每當您需要關閉彈出窗口時,只需使用上述方法即可。 請參閱Apple的文檔
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.