title: how to share a .mp3 file by UIActivityViewController with Swift?
body: <p>In my app I download a music file with extension .mp3 and save it to DocumentDirectory. After I retrieve the url and create a NSData variable, share it on Telegram by UIActivityViewController. The file appeared on telegram has no extension and doesn't play. Its name is "file". I want the music appears like "test.mp3" on Telegram. Here is my code:</p>
  
  <pre><code>var paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0].stringByAppendingString("/test.mp3")                    
  
  let soundData=NSData(contentsOfFile: paths)
  
  let r = NSURL(fileURLWithPath: paths)
  
  let activityViewController = UIActivityViewController(activityItems: [r] , applicationActivities: nil)
  </code></pre>