for fileURL in /* ... */ {
	let resourceValues = try fileURL.resourceValues(forKeys: [.typeIdentifierKey])
	if let type = resourceValues.typeIdentifier {
		let description = UTTypeCopyDescription(type as CFString)?.takeUnretainedValue()
		print("\\\\(fileURL)'s type: \\\\(description)")

		if UTTypeConformsTo(type as CFString, kUTTypeImage) {
			drawPicture(at: fileURL)
		} else if UTTypeConformsTo(type as CFString, kUTTypeAudio) {
			playSong(at: fileURL)
		}
	}
}

import UniformTypeIdentifiers

for fileURL in /* ... */ {
	let resourceValues = try fileURL.resourceValues(forKeys: [.contentTypeKey])
	if let type = resourceValues.contentType {
		let description = type.localizedDescription
		print("\\\\(fileURL)'s type: \\\\(description)")

		if type.conforms(to: .image) {
			drawPicture(at: fileURL)
		} else if type.conforms(to: .audio) {
			playSong(at: fileURL)
		}
	}
}

extension UTType {
	// export는 이 앱이 해당 타입을 만들고, 관련 책임을 가지고 있다는 것
	public static let myFileFormat = UTType(exportedAs: "com.example.myfileformat")
	// 해당 타입을 알긴 하지만, 나보다 더 잘 아는 앱이 있을 것이다.
 // 만약 owner가 내가 원하는 속성과 다르게 UTI를 정의했다면 시스템이 즉석에서 바꿔준다.
  public static var competitiorFileFormat: UTType {
		UTType(importedAs: "com.competitor.fileformat")
	}
}

/// URL 타입의 새로운 프로퍼티
let resourceValues = try fileURL.resourceValues(forKeys: [.contentTypeKey])
if let type = resourceValues.contentType {/* ... */}

/// 파일 이름 생성
var fileURL = directoryURL.appendingPathComponent("My Doctoral Thesis", comformingTo: .rtf)
fileURL.appendingPathExtension(for: .html)
_ = ("Space Kitty 2004 FINAL v10.4 DRAFT" as NSString).appendingPathExtension(for: .pdf)

struct MyGreatView: View {
	@State var text: String? = nil
	
	var body: some View {
		MyGreatView(content: $text)
			.onDrop(of: [.text], isTergeted: nil){ providers in
			_ = providers.first?.loadObject(ofClass: String.self) { string, error in 
			text = string
		}
		return true
	}
}

let icon = NSWorkSpace.shared.icon(for: .vCard)
NSOpenPanel().allowedContentTypes = [.usd, .usdz, realityFile] // NSSavePanel도 동일