title: NSFileManager OS X Last Modify Date
body: <p>I have two questions on following code:</p>
  
  <p>1) How to get the directory last modified/update date using the NSFileManager as coded below?</p>
  
  <p>2) The array print out only the last record, how to get the result print out in </p>
  
  <pre><code>[
  ["ProjectName":"Project 1", "ProjectURL":"/Users/abc/Documents/MyProjectFolder/Project 1"],
  ["ProjectName":"Project 2", "ProjectURL":"/Users/abc/Documents/MyProjectFolder/Project 2"]
  ]
  </code></pre>
  
  <p>My code as below:</p>
  
  <pre><code>let documentsDirectoryURL =  try! NSFileManager().URLForDirectory(.DocumentDirectory, inDomain: .UserDomainMask, appropriateForURL: nil, create: true)
  
  var bool: ObjCBool = false
  
  myPath = NSURL(string: String(documentsDirectoryURL) + "MyProjectFolder")
  var filevar: [String:String] = [:]
      if NSFileManager().fileExistsAtPath(myPath.path!, isDirectory: &amp;bool) {
          if bool.boolValue {
              let fileManager =  NSFileManager.defaultManager()
              let files = try! fileManager.contentsOfDirectoryAtURL(myPath, includingPropertiesForKeys: nil, options: [])
              for file in files {
                  let filename = file.lastPathComponent
                  let fileurl = file.path
                  if filename != ".DS_Store"{
                      filevar = ["ProjectName":filename!, "ProjectURL": fileurl!]
                  }
               }
               print("Result:\n \(filevar)")
           }
       }
  </code></pre>