I'm trying to implement background refresh in a iOS App . I need to call a class call "updatedropinanddropout" based on the location.I have added timer class while the application is in foreground it works fine, When the application goes to background it's not working. I mean I cannot call the class.
Timer.scheduledTimer(timeInterval: 4, target: self, selector: #selector(runCode), userInfo: nil, repeats: true)
I have gone through apple documentation func setMinimumBackgroundFetchInterval(_ minimumBackgroundFetchInterval: TimeInterval)
I don't know how to use this function