20

I want to develop ios share extention with custom callout. In apple documents

To provide a custom compose view instead of the standard one, deselect “Use standard social compose interface” in the Xcode target-adding pane. When this checkbox is deselected, the default SharingViewController class is based on NSViewController or UIViewController, depending on the platform you chose.

but I can't find the check box. Can anyone show me how to disable it and is there any good tutorials for share extention.

Thanks

Andrew
  • 15,357
  • 6
  • 66
  • 101
Canberk Ersoy
  • 428
  • 1
  • 5
  • 13

2 Answers2

35

It looks like that option was removed (or never made it to a public release).

Anyway, from reading the description, it sounds like you just need to create a share extension, and change the ShareViewController's superclass from SLComposeServiceViewController to UIViewController, and get rid of the isContentValid, didSelectPost, and configurationItems stub methods in the class definition.

Then you can set up your view however you like in MainInterface.storyboard.

rob mayoff
  • 375,296
  • 67
  • 796
  • 848
  • 10
    extensionContext is also available in the custom UIViewController since this is in UIViewController class. At first I was puzzled of how you would go about accessing it. – Genki Oct 21 '14 at 18:03
  • 3
    thanks rob. I scoured the docs as much as I could for a definitive answer on this. Was really hoping there was a method like `presentComposeView:animated:` that was included by apple. but even looking at the stack trace for the method calls and peeking at the SLComposeServiceViewController headers didn't give that impression. Annoying you can't even use the default implementation and just not present the default view via something like `self.composeView = [YourCustomView alloc] init];` – Louis Tur Jan 23 '15 at 01:13
  • Can any one help me to know that can we use share extention container app view controller for display custom layout – Anita Nagori Jul 14 '17 at 07:32
  • How to get the shared resource(from which this activitycontroller is initiated) in this controller – Mehul Thakkar Aug 21 '17 at 09:25
  • For what it's worth, the apple documentation has not been updated to this effect as of the posting of this comment. https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/Share.html – Russ J Oct 02 '19 at 19:00
  • That document is in the “Documentation Archive” library, and Apple's official statement is “[This library is no longer being updated.](https://developer.apple.com/library/archive/navigation/)”. – rob mayoff Oct 02 '19 at 21:24
2

This answer above deserved an update. We should not change super class of ShareViewController, instead configure it via configurationItems to add configuration options via table cells.

This tutorial show how to do it properly.

Gray
  • 346
  • 1
  • 5
  • 4
    The OP want's to use a completely custom view for ShareViewController, not add options to the default one. – Shebuka Sep 07 '17 at 13:56