Skip to content

Instantly share code, notes, and snippets.

@alanf
Last active December 11, 2016 17:28
Show Gist options
  • Select an option

  • Save alanf/b91b3a6ca7a34ab8c6c2bd864b11f0d4 to your computer and use it in GitHub Desktop.

Select an option

Save alanf/b91b3a6ca7a34ab8c6c2bd864b11f0d4 to your computer and use it in GitHub Desktop.
if let item = extensionContext?.inputItems.first as? NSExtensionItem,
let provider = item.attachments?.first as? NSItemProvider,
provider.hasItemConformingToTypeIdentifier("public.url") {
provider.loadItem(forTypeIdentifier: "public.url", options: nil) { (coder, error) in
let url = coder as? URL
NSLog("\(url)")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment