ios - viewDidDisappear not called when use presentViewController -
i have uiviewcontroller
having method:
- (void)viewwilldisappear:(bool)animated { [super viewwilldisappear:animated]; nslog(@"disappear"); lastknownorientation = [self interfaceorientation]; } -(void)opensendvc{ sendmsgviewcontroller *vc = [[sendmsgviewcontroller alloc]initwithnibname:@"sendmsgviewcontroller" bundle:nil]; [self.navigationcontroller pushviewcontroller:vc animated:no]; }
in second view controller (sendmsgviewcontroller
) viewdidload
have following:
[self presentviewcontroller:picker animated:yes completion:null];
where picker uiimageviewpicker
.
the problem is, when call method opensendvc
new controller opened, viewwilldisappear
(of first viewcontroller) not called.
that correct behavior. here's excerpt viewwilldisappear:
uiviewcontroller api docs:
this method called in response view being removed view hierarchy. method called before view removed , before animations configured.
presenting new view controller hides other view controller doesn't count view disappearing—only being removed view hierarchy (e.g., popviewcontrolleranimated:
).
Comments
Post a Comment