title: Use of UIActivityViewController and UIActivityItemProvider to share PDF
body: <p>I need to share/open some different files under iOS e.g. an image to iCloud or an pdf to iBooks. There are several examples around for text and images but nothing for somewhat else...</p>
  
  <p>I created my own <code>UIActivityItemProvider</code>; simplified version here:</p>
  
  <pre><code>class MyItemProvider: UIActivityItemProvider {
  
    override func item() -&gt; AnyObject {
      self.placeholderItem
    }
  
    override func activityViewController(activityViewController: UIActivityViewController, dataTypeIdentifierForActivityType activityType: String?) -&gt; String {
      return kUTTypePDF as String
    }
  
    func activityViewControllerPlaceholderItem(activityViewController: UIActivityViewController) -&gt; AnyObject {
      return self.placeholderItem
    }
  }
  </code></pre>
  
  <p>And start sharing with something like:</p>
  
  <pre><code>let myPDF = NSData(contentsOfURL: NSBundle.mainBundle().URLForResource("testpdf", withExtension: "pdf")) {
  let activityVC = UIActivityViewController(activityItems: [MyItemProvider(placeHolder: myPDF)], applicationActivities: nil)
  self.presentViewController(activityVC, animated: true, completion: nil)
  </code></pre>
  
  <p>I expect a sharedialog like:</p>
  
  <p><a href="https://i.stack.imgur.com/WHQVf.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/WHQVf.jpg" alt="enter image description here"></a></p>
  
  <p>But all I get is:</p>
  
  <p><a href="https://i.stack.imgur.com/ZWRoF.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/ZWRoF.jpg" alt="enter image description here"></a></p>
  
  <p>Any suggestions?</p>