オンラインで見つけたチュートリアル(https://www.raywenderlich.com/85528/user-accounts-ios-ruby-rails-swift#next_section)に基づいて、電話のカメラにアクセスするアプリケーションを開発しようとしています。Swift 1.2 to swift 2:Objective Cメソッドとオプションのメソッドとの競合
Objective-C method '
imagePickerController: didFinishPickingMediaWithInfo:
' provided by method 'imagePickerController(_:didFinishPickingMediaWithInfo:)
' conflicts with optional requirement methodimagePickerController(_:didFinishPickingMediaWithInfo:)
これは、エラーは
// Camera Extension
extension SelfieCollectionViewController : UINavigationControllerDelegate, UIImagePickerControllerDelegate {
func displayCameraControl() {
var imagePickerController = UIImagePickerController()
imagePickerController.delegate = self
imagePickerController.allowsEditing = true
if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera) {
imagePickerController.sourceType = UIImagePickerControllerSourceType.Camera
if UIImagePickerController.isCameraDeviceAvailable(UIImagePickerControllerCameraDevice.Front) {
imagePickerController.cameraDevice = UIImagePickerControllerCameraDevice.Front
} else {
imagePickerController.cameraDevice = UIImagePickerControllerCameraDevice.Rear
}
} else {
imagePickerController.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
}
self.presentViewController(imagePickerController, animated: true, completion: nil)
}
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) {
}
}
以下のように影響を受けるコードブロックがある
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) {}
を投げられたコードです。しかし、私のカメラ拡張imagePickerController機能は、このエラーを投げ続けますで
完全なコードブロックは、ここではライン()の111行目にあります。