0

I have just an application with 1 button and this the ViewController attached :


import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }

    @IBAction func test(_ sender: Any) {
        UIApplication.shared.open(URL(string: "https://www.google.fr")!, options: [:], completionHandler: nil)
    }

}

When i click on the button, Safari open Google, i can come back to my app, but i have a warning message in the Xcode console :

2020-02-06 11:07:24.851814+0100 TabApp[6275:418659] Can't end BackgroundTask: no background task exists with identifier 1 (0x1), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.

Anyone know how to avoid this warning ?

Best regards

  • Which iOS and Xcode version are you using? – PGDev Feb 06 '20 at 10:20
  • 1
    Does this answer your question? [Can't endBackgroundTask: no background task exists with identifier, or it may have already been ended](https://stackoverflow.com/questions/23882495/cant-endbackgroundtask-no-background-task-exists-with-identifier-or-it-may-ha) – PGDev Feb 06 '20 at 10:21

1 Answers1

0

This should do the trick - this are typically logs from the OS.

Select your Scheme -> Edit Scheme -> Run -> set OS_ACTIVITY_MODE to disable

enter image description here

charlyatwork
  • 1,187
  • 8
  • 13