title: Loader with use NotificationCenter
body: <p>I have code:</p>
  
  <p>MainView.swift:</p>
  
  <pre><code>override func viewWillAppear(_ animated: Bool) {
          super.viewWillAppear(true)
          // Register to receive notification
          NotificationCenter.default.addObserver(self, selector: #selector(MainViewControler.StartUpdatingSplash), name: NSNotification.Name("StartUpdatingSplashNotificationName"), object: nil)
  
          //new code
          NotificationCenter.default.addObserver(self, selector: #selector(MainViewControler.FinishUpdatingSplash), name: NSNotification.Name("FinishUpdatingSplashNotificationName"), object: nil)
  
      }
  
      @objc func StartUpdatingSplash() {
          DispatchQueue.global().async {
              EZLoadingActivity.show("LoadingMessage4".localized(), disableUI: true)
          }
          print("##### NOTIFICATION STEP: 1")
      }
  
      @objc func FinishUpdatingSplash() {
          DispatchQueue.global().async {
              EZLoadingActivity.hide()
          }
          // Stop listening notification
          NotificationCenter.default.removeObserver(self, name: Notification.Name("StartUpdatingSplashNotificationName"), object: nil)
          print("##### NOTIFICATION FINISH STEP: 2")
      }
  </code></pre>
  
  <p>App.swift: </p>
  
  <pre><code>var filesToDownload = [FilesToDownload]()
  var filesToDownloadPDF = [FilesToDownload]()
  
  struct FilesToDownload {
      var fileInternetUrl: String?
      var fileName: String?
      var savedURL: String?
      var productImageUrl: URL?
      var fileSize: Int
  }    
  
  func startDownloadFiles(filesArray: [FilesToDownload], filesType: Int){
          // Post notification
          NotificationCenter.default.post(name: Notification.Name("StartUpdatingSplashNotificationName"), object: nil)
          for files in filesArray{
              if filesType == 1 {
                  print ("PLIKI DO SCIAGNIECIA: \(files)")
                  checkRemoteImage(fileInternetUrl: files.fileInternetUrl!, fileName: files.fileName!, savedURL: files.savedURL!, productImageUrl: files.productImageUrl!, fileSize: files.fileSize)
              } else {
                  print ("PLIKI DO SCIAGNIECIA PDF: \(files)")
                  checkRemotePdf(fileInternetUrl: files.fileInternetUrl!, fileName: files.fileName!, savedURL: files.savedURL!, productPdfUrl: files.productImageUrl!, fileSize: files.fileSize)
              }
          }
      }
  
  func checkRemoteImage(fileInternetUrl: String, fileName: String, savedURL: String, productImageUrl: URL, fileSize: Int){
          remoteResource(at: productImageUrl, fileSize: fileSize) { (isImage) in
              if isImage == true {
                  self.saveDownloadFiles(fileInternetUrl: productImageUrl, fileName: fileName, savedURL: savedURL)
              }
          }
      }
  
      func checkRemotePdf(fileInternetUrl: String, fileName: String, savedURL: String, productPdfUrl: URL, fileSize: Int){
          self.saveDownloadFiles(fileInternetUrl: productPdfUrl, fileName: fileName, savedURL: savedURL)
      }
  
  
      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
              }
          })
      }
  
  
  func downloadedFileFromInternet(fileInternetUrl: URL, directory: String, fileName: String , completion: @escaping completionHandler) {
          if let dir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first {
              let fileURL = dir.appendingPathComponent(directory)
  
              if !FileManager.default.fileExists(atPath: fileURL.path) {
                  do {
                      try FileManager.default.createDirectory(atPath: fileURL.path, withIntermediateDirectories: true, attributes: nil)
                  } catch {
                      NSLog("Couldn't create document directory")
                  }
              }
              do {
                  let data = try? Data(contentsOf: fileInternetUrl)
                  try data?.write(to: fileURL.appendingPathComponent(fileName), options: .atomic)
              } catch let error {
                  print("Error : \(error.localizedDescription)")
              }
  
          } 
      }
  </code></pre>
  
  <p>In function startDownloadFiles I start download my files.
  I want show loader when files is downloading <code>(EZLoadingActivity)</code>. </p>
  
  <p>Currently, after launching the splash <code>(loader EZLoadingActivity)</code> application, the splash is visible all the time, it does not hide after downloading all files.</p>
  
  <p>How can I hide these <code>EZLoadingActivity</code> after all files are downloaded from the files <code>FileToDownload / filesToDownloadPDF</code>?</p>