title: How to zip files without creating directory inside zip directory?
body: <p>I am trying to zip files at destination path. Everything works perfectly. My files are zipped at the destination URL. But the problem is when I unzip, my files are inside the directory. I don't want my files inside a directory. When I unzip, I want to see my files.</p>
  
  <p>This is my code:</p>
  
  <pre><code>func zipData() {
      let  path=NSSearchPathForDirectoriesInDomains(.documentDirectory,.userDomainMask,true).first!
      let fileManager = FileManager()
  
      var sourceURL = URL(fileURLWithPath: path)
      sourceURL.appendPathComponent("/cropsapdb_up_\(useridsaved)")
  
      var destinationURL = URL(fileURLWithPath: path)
      destinationURL.appendPathComponent("/cropsapdb_up_\(useridsaved).zip")
      do {
          let fm = FileManager.default
          let items = try fm.contentsOfDirectory(atPath: sourceURL.path)
          guard let archive = Archive(url: destinationURL, accessMode: .create) else  {
              print("returning")
              return
          }
  
          for item in items {
              sourceURL = sourceURL.appendingPathComponent("/\(item)")
  
              try archive.addEntry(with: sourceURL.lastPathComponent, relativeTo: sourceURL.deletingLastPathComponent())
              guard let archive = Archive(url: destinationURL, accessMode: .update) else  {
                  print("returning")
                  return
              }
  
              sourceURL.deleteLastPathComponent()
          }
      } catch {
  }
  </code></pre>