0

I have function in my app:

func saveDownloadFiles(fileInternetUrl: URL, fileName: String, savedURL: String){
        let cms = ServerConnect()
        cms.downloadedFileFromInternet(fileInternetUrl: fileInternetUrl, directory: savedURL, fileName: fileName ,  completion: { (data) in
            switch data {
            case .succes:
                print("DOWNLOAD: \(savedURL)/\(fileName)")
            case .error(let error):
                //self.errorLoginMessage(txt: "MainView - Error 110: Problem with download images. \(error)", title: "Blad".localized())
                print("")
                break
            }
        })
    }

I would like to reload the application after performing it. The best solution for me would be to disable and enable the application again. If you can not, maybe you can at least return to splash and then display the main view again?

trifd
  • 83
  • 1
  • 1
  • 7
  • Where is that function triggered from? Is it from you main view controller? – Do2 Jun 14 '18 at 09:17
  • What do you mean by _"reload application"_? There's no such thing as disabling or enabling an application on iOS. If you want to execute all code that usually executes after the user launches your application, simply create a function that contains all methods that need to be executed after startup and call that function when you want to "reload" your application. – Dávid Pásztor Jun 14 '18 at 09:19
  • I want refresh app mainView interface (change language version etc). It's not possible? – trifd Jun 14 '18 at 09:21
  • https://stackoverflow.com/questions/15774003/changing-root-view-controller-of-a-ios-window – Vyacheslav Jun 14 '18 at 09:34

1 Answers1

-1

Can you be more clear because there is no possible to enable and disable the application. If you need to Reload all the things with UI just call again the functions which are using inside the viewDidLoad.

sathish
  • 571
  • 1
  • 5
  • 16