After migrating to Swift4 the following code raise compile error:
public final class MediaItemView: NSView {
public override init(frame frameRect: NSRect
I've solved backwards compatibility with this extension:
extension NSPasteboard.PasteboardType {
static let backwardsCompatibleFileURL: NSPasteboard.PasteboardType = {
if #available(OSX 10.13, *) {
return NSPasteboard.PasteboardType.fileURL
} else {
return NSPasteboard.PasteboardType(kUTTypeFileURL as String)
}
} ()
}
Which means you can use NSPasteboard.PasteboardType.backwardsCompatibleFileURL