【发布时间】:2016-03-03 16:49:15
【问题描述】:
我正在尝试将我的 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(), {
})
}
}
【问题讨论】:
标签: swift photosframework swift-protocols