-
Create a new UIViewController rather than extending
SLComposeServiceViewController, and you need to add@objc (CustomShareViewController)@objc (CustomShareViewController) class CustomShareViewController: UIViewController
-
Create a UI, and remember that you cannot present or show another view controller. If you want to show different UI, you can use
alphato show or hide UI elements. -
Remember to use
extensionContext!.cancelRequest(withError: NSError())orextensionContext!.completeRequest(returningItems: [], completionHandler: nil)to close UI
Reference
http://catthoughts.ghost.io/extensions-in-ios8-custom-views/ http://blog.hellocode.co/post/share-extension/