Write the string plist for the article.

This commit is contained in:
Brent Simmons 2017-11-06 13:29:53 -08:00
parent f452021bd2
commit b79ded1eb9

View File

@ -22,11 +22,30 @@ import Data
func writableTypes(for pasteboard: NSPasteboard) -> [NSPasteboard.PasteboardType] {
return [NSPasteboard.PasteboardType]() // TODO: add types
// TODO: add more types
var types = [NSPasteboard.PasteboardType]()
if let _ = article.title {
types += [.string]
}
return types // TODO: add types
}
func pasteboardPropertyList(forType type: NSPasteboard.PasteboardType) -> Any? {
return nil // TODO: write data
// TODO: write data for all types declared in writableTypes.
let plist: Any?
switch type {
case .string:
plist = article.title ?? ""
default:
plist = nil
}
return plist
}
}