I have UIVIewController
& UITableViewContoller
in my project.I am presenting UITableViewController
on UIButton
action in first UIVIewController
and select data from tableview to display in my First UIVIewController
using Protocol
Method.
tableViewController *objPlanTable = [self.storyboard instantiateViewControllerWithIdentifier:@"presentTableView"];
objPlanTable.myDelegate = self;
objPlanTable.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:objPlanTable animated:YES completion:nil];
This is my UITableViewDelegate
Method
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *aCell = [tableView cellForRowAtIndexPath:indexPath];
if([self.myDelegate respondsToSelector:@selector(selectPlan:)])
{
[self.myDelegate selectPlan:aCell.textLabel.text];
[self dismissViewControllerAnimated:YES completion:NULL];
}
if ([self.myDelegate respondsToSelector:@selector(dismissViewControllerAnimated:completion:)])
{
[self.myDelegate backgroundChanger];
}
}
But on Completion it changes my UIVIew
Height which contains UIButton. This UIVIew
is UIViewController
>>UIView
>>UIScrollView
>>UIView
How do i keep my this UIView as it is before UITableViewController
presented;
I found similar question on StackOverFlow UIView Frame Issue,but it is for push UIVIewContoller
& did not helped.
Please Correct me if i am doing anything wrong,Any Idea/Help will be appreciated.
Done, set my ui to original state before UIViewController
presented on protocol Method.
Alternate is to Push rather than Present UIViewController
.