我有代码:
do {
try manager.createDirectory(atPath: appDir!.appendingPathComponent(path).path, withIntermediateDirectories: true, attributes: nil)
} catch {
print("Error: \(error)")
}
如何在目录中添加自定义图标(如Dropbox,Creative Cloud等)?我是否将其添加为属性?
答案 0 :(得分:1)
知道了!
NSWorkspace.shared().setIcon(#imageLiteral(resourceName: "customFolder"), forFile: appDir!.appendingPathComponent("/Files").path, options: NSWorkspaceIconCreationOptions.excludeQuickDrawElementsIconCreationOption)
使用它。