Sharing Extension in IOS8 beta

后端 未结 7 1907
天命终不由人
天命终不由人 2020-12-24 08:40

I\'m trying to create a sharing extension using the new iOS 8 app extensions. I tried to get the current URL of a Safari site to show it in a UILabel. Simple enough.

7条回答
  •  醉梦人生
    2020-12-24 09:20

    Your extension view controller should be adopting the NSExtensionRequestHandling protocol. One of this protocol's methods is:

    - (void)beginRequestWithExtensionContext:(NSExtensionContext *)context
    

    You should be waiting for this to be called before you attempt to get the NSExtensionContext. It even provides the context in the method as the context parameter.

    This was outlined in this document.

提交回复
热议问题