我收到此错误: 无法将类型'SelfieListViewController'的值分配为类型'(UIImagePickerControllerDelegate&UINavigationControllerDelegate)?'
此功能:
@objc func createNewSelfie()
{
//Create a new image picker
let imagePicker = UIImagePickerController()
//If a camera is a available, use it; otherwise, use the photo library
if UIImagePickerController.isSourceTypeAvailable(.camera)
{
imagePicker.sourceType = .camera
//If the front-facing camera is available, use that
if UIImagePickerController.isCameraDeviceAvailable(.front)
{
imagePicker.cameraDevice = .front
}
}
else
{
imagePicker.sourceType = .photoLibrary
}
//We want this object to be notified when the user takes a photo
imagePicker.delegate = self
//Present the image picker
self.present(imagePicker, animated: true, completion: nil)
}