title: How can I correct editor.photoEditorDelegate = self?
body: <p>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 <code>editor.photoEditorDelegate = self</code>.</p>
  
  <p>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:</p>
  
  <blockquote>
    <p>Cannot assign value of type 'PhotosViewController?' to type 'PhotoEditorDelegate?'</p>
  </blockquote>
  
  <p>I have tried to fix it with:</p>
  
  <pre><code>editor.photoEditorDelegate = self as? PhotoEditorDelegate
  </code></pre>
  
  <p>but it just makes the app crash when the editor is called. </p>
  
  <p>I declared the editor with:</p>
  
  <pre><code>let editor = PhotoEditorViewController(nibName:"PhotoEditorViewController",bundle: Bundle(for: PhotoEditorViewController.self))
  </code></pre>