iOS
extensionContext is nil from a presented view controller

extensionContext is nil from a presented view controller

At time when you are wokring in today extension you will face this issue where self.extensionContext.open doesn’t work or let’s say self.extensionContext is nil from presented view controller. Initially I was testing if my code regarding opening app code was wrong. And then I tried to do it from initial view controller. It worked. And I was so much thinking what went wrong.

I though if initial view controller’s extensionContext is working, why not pass that object to presented view controller. And I did exactly the same and finally it worked. Here is example code that might be helpful for you.

 

Let me know what you guys think about this. Was this helpful? Hope so. ?

Thanks

Leave a Reply