jjzjj

appropriateFor

全部标签

swift - FileManager.url 中的 appropriateFor 参数是什么(对于 :in:appropriateFor:create:)?

Apple'sinstructionsforcreatingatemporaryURL将使用FileManager.url(for:in:appropriateFor:create:)。他们给出的例子是(用Swift3重写):letdesktopURL=URL(fileURLWithPath:"/Users/Noah/Desktop/")do{lettemporaryDirectoryURL=tryFileManager.default.url(for:.itemReplacementDirectory,in:.userDomainMask,appropriateFor:desktop