Q:

How can I correct editor.photoEditorDelegate = self?

I am still a beginner at Swift programming and I am trying to build a very basic iOS app. The app requires users to take a photo and edit them on a photo editor. I am having issues with using editor.photoEditorDelegate = self.
This is what the developer of the photo editor used in his example and it gave no problem but it's not working for me. It is giving an error of:

Cannot assign value of type 'PhotosViewController?' to type 'PhotoEditorDelegate?'

I have tried to fix it with:
editor.photoEditorDelegate = self as? PhotoEditorDelegate

but it just makes the app crash when the editor is called. 
I declared the editor with:
let editor = PhotoEditorViewController(nibName:"PhotoEditorViewController",bundle: Bundle(for: PhotoEditorViewController.self))

A:

You need to make your PhotosViewController your PhotoEditorDelegate:
class PhotosViewController: PhotoEditorDelegate {

...

