8
8
9
9
import Foundation
10
10
11
- public struct AnimatableSectionModel < Section: Hashable , ItemType: Hashable >
12
- : Hashable
13
- , AnimatableSectionModelType
11
+ public struct AnimatableSectionModel < Section: IdentifiableType , ItemType: protocol < IdentifiableType , Equatable > >
12
+ : AnimatableSectionModelType
14
13
, CustomStringConvertible {
15
- public typealias Item = IdentifiableValue < ItemType >
16
- public typealias Identity = Section
14
+ public typealias Item = ItemType
15
+ public typealias Identity = Section . Identity
17
16
18
17
public var model : Section
19
18
20
19
public var items : [ Item ]
21
20
22
- public var identity : Section {
23
- return model
21
+ public var identity : Section . Identity {
22
+ return model. identity
24
23
}
25
24
26
25
public init ( model: Section , items: [ ItemType ] ) {
27
26
self . model = model
28
- self . items = items. map ( IdentifiableValue . init )
27
+ self . items = items
29
28
}
30
29
31
30
public init ( original: AnimatableSectionModel , items: [ Item ] ) {
@@ -38,10 +37,6 @@ public struct AnimatableSectionModel<Section: Hashable, ItemType: Hashable>
38
37
}
39
38
40
39
public var hashValue : Int {
41
- return self . model. hashValue
40
+ return self . model. identity . hashValue
42
41
}
43
42
}
44
-
45
- public func == < S, I> ( lhs: AnimatableSectionModel < S , I > , rhs: AnimatableSectionModel < S , I > ) -> Bool {
46
- return lhs. model == rhs. model
47
- }
0 commit comments