jaco-g
8/9/2017 - 10:24 AM

From https://stackoverflow.com/questions/13497500/retrieve-file-creation-or-modification-date

func fileModificationDate(url: URL) -> Date? {
    do {
        let attr = try FileManager.default.attributesOfItem(atPath: url.path)
        return attr[FileAttributeKey.modificationDate] as? Date
    } catch {
        return nil
    }
}