All you need to know about Today Extensions (Widget) in iOS 10
Payal Gupta

Very Helpful tutorial. I have implemented share extension in which i need data sharing between extension and host app i.e. app groups suit in UserDefaults.

NOTE If in a case you want to open your host app via extension and if this not works

self.extensionContext?.open(URL(string: “YOUR_URL_SCHEME://”)!, completionHandler: nil)

Then you can try like this may this helps

let url = URL(string: “YOUR_URL_SCHEME://”)
 var responder = self as UIResponder?
 let selectorOpenURL = sel_registerName(“openURL:”)
 while (responder != nil) {
 if (responder?.responds(to: selectorOpenURL))! {
 let _ = responder?.perform(selectorOpenURL, with: url)
 responder = responder!.next
 self.extensionContext!.completeRequest(returningItems: [], completionHandler: nil)

P.S. Issue can arise as case scenarios are different.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.