README and documentationIs there any reason IGListDiffable could not be implemented on Struct?
the following code returns this error:
Non-class type 'Foo' cannot conform to class protocol 'IGListDiffable'
struct Foo: IGListDiffable {
let id: String
func diffIdentifier() -> NSObjectProtocol {
return id as NSObjectProtocol
}
func isEqual(object: Any?) -> Bool {
return false
}
}
Thanks @pgherveou !
See the discussion in #35.
In short, this is a limitation in the Swift compiler when bridging _from_ Objective-C _to_ Swift. It's difficult (or impossible) to determine if reference semantics are required, or not. Thus, protocols are imported as @objc which requires a reference (class) type.
Most helpful comment
Thanks @pgherveou !
See the discussion in #35.
In short, this is a limitation in the Swift compiler when bridging _from_ Objective-C _to_ Swift. It's difficult (or impossible) to determine if reference semantics are required, or not. Thus, protocols are imported as
@objcwhich requires a reference (class) type.