I am trying replicate some Objective C cocoa in Swift. All is good until I come across the following:
// Set a new type and creator: unsigned long type = \'TEXT\
Swift 5 Update:
extension String { func osType() -> OSType { return OSType( data(using: .macOSRoman)? .withUnsafeBytes { $0.reduce(into: UInt(0)) { $0 = $0 << 8 + UInt($1) } } ?? 0 ) } }