 
 import UIKit
 import RxSwift
+import MobileCoreServices
 
 typealias PasteboardItemArray = Array<Dictionary<String, AnyObject>>
 


    let pasteboardItems = Variable(Array<PasteboardItem>())
    let changeCount = Variable(0)

    let disposeBag = DisposeBag()

    init() {
        let pasteboard = UIPasteboard.generalPasteboard()
        
        let observableString = pasteboard.rx_observe(String.self, "string")
        let observableImage = pasteboard.rx_observe(UIImage.self, "image")
        
        observableString.subscribeNext { [weak self] string in
            if let item = string {
                self?.addItem(item)
            }
        }.addDisposableTo(disposeBag)
        
        observableImage.subscribeNext { [weak self] image in
            if let item = image {
                self?.addItem(item)
            }
        }.addDisposableTo(disposeBag)
    }

    class var pasteboardService: PasteboardService {

            return .Image(image)
        }

        fatalError("unsupported types")
    }

