Oleksandr Matrosov
Oleksandr Matrosov

Reputation: 27159

iOS Custom Share Extension get content

I want to create custom share extension and I would like to access to data that I want to share.

So as I read we need to inherit from UIViewController instead of SLComposeServiceViewController to have custom interface.

So with default interface I see this:

enter image description here

How can I get information from context? I mean get link I want to share, and for example image?

I know that there is some extensionContext in SLComposeServiceViewController, but in my case with custom UI I don't have it. In any case how to get that information form NSExtensionContext, because I have print out it in console and there is simple data structure, like we see in JSON or smth like this.

So the question is about getting link from context with custom UI, maybe I am on a wrong way.

Upvotes: 4

Views: 1971

Answers (1)

user3137679
user3137679

Reputation: 61

The default UIViewController class has an extensionContext property!

Upvotes: 4

Related Questions