I\'m using popoverPresentationController
to show my popover. The UITableViewController
used to show as popover is created programmatically and will usu
First thing first: All comments are good and help full. I have did little change in my logic which makes my VC as reusable component.
Calling this method inside viewWillAppear:(BOOL)animated
:
-(void) setPopOverPreferedContentHeight {
if (self.popoverPresentationController && self.tableView.contentSize.height < MAX_POPOVER_HEIGHT) {
self.preferredContentSize=self.tableView.contentSize;
} else if (self.popoverPresentationController){
self.preferredContentSize = CGSizeMake(self.tableView.contentSize.width, MAX_POPOVER_HEIGHT);
}
}