title: Swift xcode error: "Cannot assign value of type 'SendEmailToVerifyPassword' to type 'MFMailComposeViewControllerDelegate?'
body: <p>The purpose of my project is to have a login/create account screen and the user clicks a button to have an email sent to them with their username &amp; password to verify it.</p>
  
  <p>NOTE: username, password, and email are global variables declared in a different class of my project
  EDIT: someone said to add something to the end of the file? What does that even mean? Can someone please help?</p>
  
  <p>Screenshot of error:
  <a href="http://i.stack.imgur.com/7ikzS.png" rel="nofollow">enter image description here</a></p>
  
  <p>SendEmailToVerifyPassword class:</p>
  
  <pre><code>import UIKit
  import MessageUI
  class SendEmailToVerifyPassword: MFMailComposeViewController
  {
      func ViewDidLoad()
      {
          super.viewDidLoad()
      }
      func configuredMailComposeViewController() -&gt; MFMailComposeViewController {
          let mailComposerVC = MFMailComposeViewController()
          mailComposerVC.mailComposeDelegate = self // Extremely important to set the --mailComposeDelegate-- property, NOT the --delegate-- property
  
          mailComposerVC.setToRecipients([email])
          mailComposerVC.setSubject("Your password/username verification")
          mailComposerVC.setMessageBody("Hello.\n Your username is: \(username)\n Your password is \(password)", isHTML: false)
  
          return mailComposerVC
      }
  
      func showSendMailErrorAlert() {
          let sendMailErrorAlert = UIAlertView(title: "Could Not Send Email", message: "Your device could not send e-mail.  Please check e-mail configuration and try again.", delegate: self, cancelButtonTitle: "OK")
          sendMailErrorAlert.show()
      }
  
      func mailComposeController(controller: MFMailComposeViewController, didFinishWithResult result: MFMailComposeResult, error: NSError?) {
  
          switch result.rawValue {
  
          case MFMailComposeResultCancelled.rawValue:
              print("Cancelled mail")
          case MFMailComposeResultSent.rawValue:
              print("Mail Sent")
          default:
              break
          }
          self.dismissViewControllerAnimated(true, completion: nil)
      }
  
  
  
  }
  </code></pre>
  
  <p>Screenshot of storyboard button viewcontroller (click here is the button I want to activate the email):
  <a href="http://i.stack.imgur.com/1Wlw6.png" rel="nofollow">enter image description here</a></p>