Как существует каталог проверки?IOS

Программируем под IOS
Anonymous
Как существует каталог проверки?

Сообщение Anonymous »

У меня есть функции для создания каталогов:

Код: Выделить всё

func createSystemFolders(){
// Create a FileManager instance
let fileManager = FileManager.default
do {
try fileManager.createDirectory(atPath: "json", withIntermediateDirectories: true, attributes: nil)
}
catch let error as NSError {
debugPrint("\(ErrorsLabels.AppDelegate01): \(error)")
}

do {
try fileManager.createDirectory(atPath: "inspirations", withIntermediateDirectories: true, attributes: nil)
}
catch let error as NSError {
debugPrint("\(ErrorsLabels.AppDelegate02): \(error)")
}

do {
try fileManager.createDirectory(atPath: "products", withIntermediateDirectories: true, attributes: nil)
}
catch let error as NSError {
debugPrint("\(ErrorsLabels.AppDelegate03): \(error)")
}
}
Мне нужна вторая функция для проверки существования каталога.

Как я могу это проверить?

Подробнее здесь: https://stackoverflow.com/questions/504 ... tory-exist

Вернуться в «IOS»