ios - UITabBar dissapear when dismiss UIImagePickerController -
in screenshot below, structure of storyboard uitabbarcontroller
-> uinavigationcontroller
-> uiviewcontroller
. in uiviewcontroller
, call .camera
using uiimagepickercontroller
in viewdidload
. however, when users hit cancel inside camera, dismiss viewcontroller, , tab bar dissapears!
this codes dismiss:
func imagepickercontrollerdidcancel(picker: uiimagepickercontroller) { dismissviewcontrolleranimated(true, completion: nil) }
edit: added calling of uiimagepickercontroller
override func viewdidload() { super.viewdidload() let picker = uiimagepickercontroller() picker.delegate = self picker.sourcetype = .camera presentviewcontroller(picker, animated: true, completion: nil) }
try present imagepicker controller 'overcurrentcontext'
imagepicker.modalpresentationstyle = uimodalpresentationstyle.overcurrentcontext
or set in storyboard in uiviewcontroller, hope can you.
Comments
Post a Comment