2017-08-28 2 views
0

Ich habe den Code:Benutzerverzeichnis Icon Swift

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

Wie füge ich ein benutzerdefiniertes Symbol in das Verzeichnis (wie Dropbox, Creative Cloud, etc.)? Füge ich es als Attribut hinzu?

+0

Suchen Sie es selbst. https://stackoverflow.com/search?q=%5Bosx%5D+folder+icon –

Antwort

0

Verstanden!

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

Verwenden Sie das.

+0

Ändert es das App-Icon oder das Verzeichnis-Icon? –

+0

@LeoDabus Verzeichnissymbol für einen bestimmten Pfad. – ctkrocks

+0

Ihr Code zeigt keine Pah –

Verwandte Themen