判断路径隐藏状态:
func fileUrlIsInvisible(_ fileUrl: URL) -> Bool {
let myUrl = fileUrl
var isHidden: AnyObject?
var keys = Set<URLResourceKey>()
keys.insert(URLResourceKey.isHiddenKey)
do{
isHidden = try myUrl.resourceValues(forKeys: keys) as AnyObject
return (isHidden as? NSNumber)?.boolValue ?? false
} catch let error as NSError {
print(error.debugDescription)
return false
}
}