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
1 changed files with 21 additions and 2 deletions

View File

@ -22,11 +22,30 @@ import Data
func writableTypes(for pasteboard: NSPasteboard) -> [NSPasteboard.PasteboardType] { 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? { 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
} }
} }