實施PHPhotoLibraryChangeObserver協議我想設置我的AssetService爲changeObserver,但我得到了如下因素的錯誤:在迅速
Error:(8, 14) type 'AssetService' does not conform to protocol 'PHPhotoLibraryChangeObserver'
雖然photoLibraryDidChange是唯一需要的方法。這裏是我的代碼:
import UIKit
import Photos
public class AssetService : PHPhotoLibraryChangeObserver {
public init() {
// here I do some other stuff
PHPhotoLibrary.sharedPhotoLibrary().registerChangeObserver(self)
}
public func photoLibraryDidChange(changeInstance: PHChange) {
dispatch_async(dispatch_get_main_queue(), {
})
}
}