사진을 찍으려면 UIImagePickerController
을 선물하고 있습니다. 문제는 사진을 찍거나 취소하는 것입니다. UIImagePickerController
나는 이전의 흰색 화면이 아닌 ViewController
으로 돌아갑니다. 아직 내 navigation bar
만 있습니다. 다른 view
(내비게이션 바 포함)을 클릭하면 확인이되고, UIImagePickerController
라고 표시된 탭으로 돌아 오면 여전히 흰색이됩니다.현재 흰색 화면 UIImagePickerController 후
let picker = UIImagePickerController();
picker.delegate = self;
picker.mediaTypes = [swiftString];
picker.allowsEditing = true
picker.sourceType = UIImagePickerControllerSourceType.camera;
picker.cameraCaptureMode = .photo
self.present(picker, animated:true, completion:nil);
기각 :
picker.dismiss(animated: true, completion:nil);
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
picker.dismiss(animated: true, completion:nil);
}
누군가가 아이디어 감사의 경우!
업데이트 : 내가 present method
와보기를 호출 할 때
흰색 화면이 항상 나타납니다. 누군가가 다른 대안이있는 경우
guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else {return}
appDelegate.navigationController.present(picker, animated: true, completion: nil)
그것을 해결하기 위해 : 그래서 내가
이 내 문제를 해결 (... 계층 구조)는 네비게이션 컨트롤러와 충돌 생각!
에
.modalPresentationStyle
를 설정하면'UIImagePickerController'을 기각되는 방법? – Poles@Poles 물론, 게시물을 편집하여 표시합니다. – Makaille
이미지 선택 도구에 필요한 UINavigationControllerDelegate의 하위 클래스를 만들었습니까? – pbush25