how to use NSTimer background in swift?

 var backgroundTaskIdentifier: UIBackgroundTaskIdentifier?
  backgroundTaskIdentifier = UIApplication.shared.beginBackgroundTask(expirationHandler: {
            UIApplication.shared.endBackgroundTask(self.backgroundTaskIdentifier!)
        })
        let timer = Timer.scheduledTimer(timeInterval: 1,
                                         target: self,
                                         selector: #selector(timerCallBack),
                                         userInfo: nil,
                                         repeats: true)
        timer.fire()
    func timerCallBack(){   
        print("1")
    }