title: How to send and receive custom data with AirDrop
body: <p>I've been struggling with this for ages now as I can't find any detailed examples.</p>
  
  <p>In my app I have an array of custom data that I want to send to another user with the same app, via AirDrop.</p>
  
  <p>The first step is sending the data:</p>
  
  <pre><code>@IBAction func share_Button_Click(sender: UIBarButtonItem)
  {
      let dataToShare: NSData = getMyCustomNSData()
  
      let controller = UIActivityViewController(activityItems: [dataToShare], applicationActivities: nil)
      controller.excludedActivityTypes = [UIActivityTypePostToFacebook, UIActivityTypePostToTwitter, UIActivityTypePostToWeibo, UIActivityTypePrint, UIActivityTypeCopyToPasteboard, UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll, UIActivityTypePostToFlickr, UIActivityTypePostToTencentWeibo, UIActivityTypeMail, UIActivityTypeAddToReadingList, UIActivityTypeOpenInIBooks, UIActivityTypeMessage]
  
      self.presentViewController(controller, animated: true, completion: nil)
  }
  </code></pre>
  
  <p>This converts my data to an NSData object, the user gets the AirDrop share option, and of the data goes to another phone. So far so good...</p>
  
  <p>But how does the other user's app know how to receive it?</p>
  
  <p>I've read about custom UTI types and have declared one, but to be honest I don't know what to put in the declaration. And how do you indicate to iOS that the data you are sending conforms to this particular UTI?</p>
  
  <p>There are AirDrop examples here and there online, but they focus on sharing common types like images, and no one I have found has worked through sharing a custom data type in detail.</p>
  
  <p>Can anyone help?</p>