I am trying to create a custom view controller to be used with a share extension. Everything works, but I don\'t know how to dismiss the custom view controller. Basically I
You should end your sharing extensions work with one of these two calls:
self.extensionContext!.completeRequestReturningItems(nil, completionHandler: nil)
self.extensionContext!.cancelRequestWithError(NSError())
Apples share extension docs
updated for swift 4:
self.extensionContext!.completeRequest(returningItems: nil, completionHandler: nil)
self.extensionContext!.cancelRequest(withError:NSError())