0

So I have 2 targets , I managed to open the SecondTarget from the FristTarget with:

        if UIApplication.shared.canOpenURL(aUrl!){
        if #available(iOS 10.0, *) {
            UIApplication.shared.open(aUrl!)
        } else {
            // Fallback on earlier versions
        }

I'm also navigating to a specific VC when the first time the SecondTarget opens because i now that a specific VC is called the first time and I did some modifications in there.

But i'm getting stuck when , let's say the SecondTarget is already running and I'm doing the specific task to open it from the FirstTarget...now it only swap to it since it was already open..not executing anymore the flow I wrote. It's also frustrating because the breakpoints aren't triggered in the SecondApp...Any ideas? thanks

Mohamed Lee
  • 267
  • 1
  • 3
  • 18
  • Try to do it with POST NOTIFICATION and take notification name into app delegates and than listen for the notification to be post. – Muhammad Anum Mar 12 '18 at 14:25
  • Can you give me an example pls? Like : `NotificationCenter.default.addObserver(self, selector: #selector(AccountViewController.promptForNewMessage(_:)), name: NSNotification.Name("SecondTarget"), object: nil)` . and for SecondTarget how to make the method to know that it has requested to perform the same flow? – Mohamed Lee Mar 12 '18 at 14:51

0 Answers0