How do you create a UTType for System Declared Uniform Type Identifiers for folder?

539 views Asked by At

I see all kinds of examples for using a file or an extension but I am trying to call let imag = NSWorkspace.shared.icon(for: <#T##UTType#>) and I don't see any init method in UUType that takes a identifier e.g. folder.

1

There are 1 answers

0
Vadim Belyaev On BEST ANSWER

UTType is declared in the Uniform Type Identifiers framework.

All uou need to do is import UniformTypeIdentifiers and then you'll be able to write things like UTType.folder.