ios - UIImagepicker navigates to superview not to the subview containing UIimagpicker -
on viewcontrollera have added few uiviews , viewcontrollerb's view asubview. viewcontrollerb has imagepicker. after picking image navigates viewcontrollera. how can return viewcontrollerb without disturbing other views?
-(void)changeimage:(id)sender {uiimagepickercontroller *picker=[[uiimagepickercontroller alloc]init]; picker.delegate=self; picker.allowsediting=yes; picker.sourcetype=uiimagepickercontrollersourcetypecamera; [self presentviewcontroller:picker animated:yes completion:null]; }
add viewcontroller b viewcontroller a. in vc a:
swift 3:
instanceofvcb.willmove(toparentviewcontroller: self) addchildviewcontroller(instanceofvcb) view.addsubview(instanceofvcb.view) // add desired contraints instanceofvcb.view instanceofvcb.didmove(toparentviewcontroller: self)
obj-c:
[instanceofvcb willmovetoparentviewcontroller: self]; [self addchildviewcontroller: instanceofvcb]; [self.view addsubview: instanceofvcb.view]; // add desired contraints instanceofvcb.view; [instanceofvcb didmovetoparentviewcontroller: self];
Comments
Post a Comment