remove unused function countFiles
This commit is contained in:
@@ -721,36 +721,6 @@ class ViewController: UIViewController, UIGestureRecognizerDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
func countFiles() -> Int {
|
||||
var count = 0
|
||||
if let enumerator = fileManager.enumerator(
|
||||
at: currentPath, includingPropertiesForKeys: [.isDirectoryKey],
|
||||
options: [.skipsHiddenFiles]
|
||||
) {
|
||||
for case let dir as URL in enumerator {
|
||||
do {
|
||||
if let enumerator = fileManager.enumerator(
|
||||
at: dir, includingPropertiesForKeys: [.isRegularFileKey],
|
||||
options: [.skipsHiddenFiles]
|
||||
) {
|
||||
for case let file as URL in enumerator {
|
||||
let resourceValues = try file.resourceValues(forKeys: [
|
||||
.isRegularFileKey,
|
||||
])
|
||||
if resourceValues.isRegularFile == true {
|
||||
count += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch {
|
||||
print("Error reading file attributes for \(dir):", error)
|
||||
}
|
||||
}
|
||||
}
|
||||
return count
|
||||
}
|
||||
|
||||
func setupScrollingCollectionView() {
|
||||
let layout = UICollectionViewFlowLayout()
|
||||
layout.minimumInteritemSpacing = 0
|
||||
|
||||
Reference in New Issue
Block a user