I added a sub view from controller A. Now in controller B which is the subview controller, how can I reload view A when the user is done with B? My codes of adding subview:
ChangeProfileImage *changeProfileImage =[[ChangeProfileImage alloc] init];
changeProfileImage.modalPresentationStyle = UIModalPresentationFormSheet;
changeProfileImage.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
changeProfileImage.view.frame = CGRectMake(50, 50, 300, 300);
UIView *dimBackgroundView = [[UIView alloc] initWithFrame:self.view.bounds];
dimBackgroundView.backgroundColor = [[UIColor grayColor] colorWithAlphaComponent:.5f];
[self.view addSubview:dimBackgroundView];
[self.view addSubview:changeProfileImage.view];
you can set a tag for “dimbackground” .. and remove it like this:
To Refresh your viewController :
when the user click the submit button and you remove the B view .. post a notification using
NSNotificationCenterlike this :and in controllerA .. viewDidLoad For example add it as observer like this
and you will implement this function :