title: Trying to export to csv but how do i implement from delegate?
body: <p>[new to swift] I testing this function to export some simple file</p>
  
  <pre><code>    @IBAction func exportFile(delegate: UIDocumentInteractionControllerDelegate) {
          print("export csv")
         let fileName = tmpDir.stringByAppendingPathComponent("myFile.csv")
          let url: NSURL! = NSURL(fileURLWithPath: fileName)
  
          if url != nil {
              let docController = UIDocumentInteractionController(URL: url)
              docController.UTI = "public.comma-separated-values-text"
              docController.delegate = delegate
              docController.presentPreviewAnimated(true)
  
          }
  }
   // Return the view controller from which the UIDocumentInteractionController will present itself.
      func documentInteractionControllerViewControllerForPreview(controller: UIDocumentInteractionController)-&gt; UIViewController {
          return self
      }
  </code></pre>
  
  <p>But when i clicked the export button i am getting the message</p>
  
  <pre><code>UIDocumentInteractionController delegate must implement documentInteractionControllerViewControllerForPreview: to allow preview
  </code></pre>
  
  <p>I thought</p>
  
  <blockquote>
    <p>class ViewController: UIViewController, UIDocumentInteractionControllerDelegate {</p>
  </blockquote>
  
  <p>Would be sufficient?</p>
  
  <p>I tried
  Self.documentInteractionControllerViewForPreview(docController)</p>
  
  <p>[edit] 
  turned out i had made the following mistake
  docController.delegate = self//delegate</p>