= self.extensionContext!.inputItems[0] as NSExtensionItem var outputItem : NSExtensionItem = inputItem.copy() as NSExtensionItem; var itemProvider : NSItemProvider = inputItem.attachments![0] as NSItemProvider if (itemProvider.hasItemConformingToTypeIdentifier("public.url")) { itemProvider.loadItemForTypeIdentifier("public.url", options: nil, completionHandler: { (urlItem, error) in if (error != nil) { println("Unable to add as a URL") //Τϥʔ༰ΛϗετΞϓϦʹ͑Δ self.extensionContext!.cancelRequestWithError(error) } else if let url = urlItem as? NSURL { //ೖྗ͞ΕͨςΩετΛઃఆ͢Δ outputItem.attributedContentText = NSAttributedString(string:self.contentText, attributes:nil); //࣮Λ͔͘ //࣮ࡍʹߘͨ͠ΞΠςϜΛϗετΞϓϦʹ͑Δ self.extensionContext!.completeRequestReturningItems([outputItem], completionHandler: nil) } }) } }