NSURL getResourceValue in swift

前端 未结 5 864
梦如初夏
梦如初夏 2021-02-13 11:54

Having trouble figuring out how to make the following call in swift:

var anyError: NSError? = nil
var rsrc: NSNumber? = nil
var success = url.getResourceValue(&a         


        
5条回答
  •  说谎
    说谎 (楼主)
    2021-02-13 12:04

    in swift 3 previous calls are not available/deprecated:

    so use:

    var keys = Set()
    keys.insert(URLResourceKey.isDirectoryKey)
    do{
        let URLResourceValues = try fileURL.resourceValues(forKeys: keys)
        }catch _{
    
       }
    

提交回复
热议问题