I am working on a project that uses tabbar system. One of the item of tabbar is JobPostingViewController. I Embed it in UINavigationController. There is a UIButton called add ne
Adding Picker as subview
try to add the imagepicker as a subview to your CreateJobPostViewController insted of presenting it and then remove it from parent in the delegtes
@IBAction func openCreateJob(sender: AnyObject) {
var picker: UIImagePickerController = UIImagePickerController()
picker.delegate = self
picker.allowsEditing = false
picker.sourceType = .PhotoLibrary
self.addChildViewController(picker)
picker.didMoveToParentViewController(self)
self.view!.addSubview(picker.view!)
}
and then
func imagePickerControllerDidCancel(picker: UIImagePickerController) {
picker.view!.removeFromSuperview()
picker.removeFromParentViewController()
}
For presenting
showing picker over currentcontext with options like edit cancel choose,
use picker.modalPresentationStyle = .overCurrentContext
//before presenting
it
presentViewController(picker, animated: true, completion: nil)