Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift3 warning imagePickerController nearly matches

While converting from old version of swift I am getting a warning for

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String: AnyObject])

The warning is

Instance method 'imagePickerController(:didFinishPickingMediaWithInfo:)' nearly matches optional requirement 'imagePickerController(:didFinishPickingMediaWithInfo:)' of protocol UIImagePickerControllerDelegae

The problem here is is that as far as my eyes tell, what it complains about and what it says nearly matches are 100% the same. How do I solve this warning?

like image 690
Tom Avatar asked Mar 08 '17 00:03

Tom


1 Answers

In newer swift version, method should be

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any])

then, warning doesn't show up.

like image 111
Kishan Bhatiya Avatar answered Sep 27 '22 18:09

Kishan Bhatiya