2017-08-28 41 views
0

我的代码:自定义目录图标斯威夫特

do { 
    try manager.createDirectory(atPath: appDir!.appendingPathComponent(path).path, withIntermediateDirectories: true, attributes: nil) 
} catch { 
    print("Error: \(error)") 
} 

如何添加自定义图标目录(如Dropbox的,创意云,等等)?我是否将其添加为属性?

+0

寻找它自己。 https://stackoverflow.com/search?q=%5Bosx%5D+folder+icon –

回答

0

明白了!

NSWorkspace.shared().setIcon(#imageLiteral(resourceName: "customFolder"), forFile: appDir!.appendingPathComponent("/Files").path, options: NSWorkspaceIconCreationOptions.excludeQuickDrawElementsIconCreationOption) 

使用它。

+0

它改变了应用图标或目录图标? –

+0

@LeoDabus特定路径的目录图标。 – ctkrocks

+0

您的代码并不显示任何PAH –