10
10
import Foundation
11
11
import UIKit
12
12
13
- /// Represents the point in time `ChatLayout` when chat layout asks about layout attributes modification.
13
+ /// Represents the point in time when `CollectionViewChatLayout` asks about layout attributes modification.
14
14
public enum InitialAttributesRequestType {
15
15
16
16
/// `UICollectionView` initially asks about the layout of an item.
@@ -21,26 +21,26 @@ public enum InitialAttributesRequestType {
21
21
22
22
}
23
23
24
- /// `ChatLayout ` delegate
24
+ /// `CollectionViewChatLayout ` delegate
25
25
public protocol ChatLayoutDelegate : AnyObject {
26
26
27
- /// `ChatLayout ` will call this method to ask if it should present the header in the current layout.
27
+ /// `CollectionViewChatLayout ` will call this method to ask if it should present the header in the current layout.
28
28
/// - Parameters:
29
- /// - chatLayout: ChatLayout reference.
29
+ /// - chatLayout: `CollectionViewChatLayout` reference.
30
30
/// - sectionIndex: Index of the section.
31
31
/// - Returns: `Bool`.
32
- func shouldPresentHeader( _ chatLayout: ChatLayout ,
32
+ func shouldPresentHeader( _ chatLayout: CollectionViewChatLayout ,
33
33
at sectionIndex: Int ) -> Bool
34
34
35
- /// `ChatLayout ` will call this method to ask if it should present the footer in the current layout.
35
+ /// `CollectionViewChatLayout ` will call this method to ask if it should present the footer in the current layout.
36
36
/// - Parameters:
37
- /// - chatLayout: ChatLayout reference.
37
+ /// - chatLayout: `CollectionViewChatLayout` reference.
38
38
/// - sectionIndex: Index of the section.
39
39
/// - Returns: `Bool`.
40
- func shouldPresentFooter( _ chatLayout: ChatLayout ,
40
+ func shouldPresentFooter( _ chatLayout: CollectionViewChatLayout ,
41
41
at sectionIndex: Int ) -> Bool
42
42
43
- /// `ChatLayout ` will call this method to ask what size the item should have.
43
+ /// `CollectionViewChatLayout ` will call this method to ask what size the item should have.
44
44
///
45
45
/// **NB:**
46
46
///
@@ -50,21 +50,21 @@ public protocol ChatLayoutDelegate: AnyObject {
50
50
/// using Autolayout Engine anyway.
51
51
///
52
52
/// - Parameters:
53
- /// - chatLayout: ChatLayout reference.
53
+ /// - chatLayout: `CollectionViewChatLayout` reference.
54
54
/// - kind: Type of element represented by `ItemKind`.
55
55
/// - indexPath: Index path of the item.
56
56
/// - Returns: `ItemSize`.
57
- func sizeForItem( _ chatLayout: ChatLayout ,
57
+ func sizeForItem( _ chatLayout: CollectionViewChatLayout ,
58
58
of kind: ItemKind ,
59
59
at indexPath: IndexPath ) -> ItemSize
60
60
61
- /// `ChatLayout ` will call this method to ask what type of alignment the item should have.
61
+ /// `CollectionViewChatLayout ` will call this method to ask what type of alignment the item should have.
62
62
/// - Parameters:
63
- /// - chatLayout: ChatLayout reference.
63
+ /// - chatLayout: `CollectionViewChatLayout` reference.
64
64
/// - kind: Type of element represented by `ItemKind`.
65
65
/// - indexPath: Index path of the item.
66
66
/// - Returns: `ChatItemAlignment`.
67
- func alignmentForItem( _ chatLayout: ChatLayout ,
67
+ func alignmentForItem( _ chatLayout: CollectionViewChatLayout ,
68
68
of kind: ItemKind ,
69
69
at indexPath: IndexPath ) -> ChatItemAlignment
70
70
@@ -74,12 +74,12 @@ public protocol ChatLayoutDelegate: AnyObject {
74
74
/// The `originalAttributes` instance is a reference type, and therefore can be modified directly.
75
75
///
76
76
/// - Parameters:
77
- /// - chatLayout: ChatLayout reference.
77
+ /// - chatLayout: `CollectionViewChatLayout` reference.
78
78
/// - kind: Type of element represented by `ItemKind`.
79
79
/// - indexPath: Index path of the item.
80
- /// - originalAttributes: `ChatLayoutAttributes` that the `ChatLayout ` is going to use.
80
+ /// - originalAttributes: `ChatLayoutAttributes` that the `CollectionViewChatLayout ` is going to use.
81
81
/// - state: `InitialAttributesRequestType` instance. Represents when is this method being called.
82
- func initialLayoutAttributesForInsertedItem( _ chatLayout: ChatLayout ,
82
+ func initialLayoutAttributesForInsertedItem( _ chatLayout: CollectionViewChatLayout ,
83
83
of kind: ItemKind ,
84
84
at indexPath: IndexPath ,
85
85
modifying originalAttributes: ChatLayoutAttributes ,
@@ -91,11 +91,11 @@ public protocol ChatLayoutDelegate: AnyObject {
91
91
/// The `originalAttributes` instance is a reference type, and therefore can be modified directly.
92
92
///
93
93
/// - Parameters:
94
- /// - chatLayout: ChatLayout reference.
94
+ /// - chatLayout: `CollectionViewChatLayout` reference.
95
95
/// - kind: Type of element represented by `ItemKind`.
96
96
/// - indexPath: Index path of the item.
97
- /// - originalAttributes: `ChatLayoutAttributes` that the `ChatLayout ` is going to use.
98
- func finalLayoutAttributesForDeletedItem( _ chatLayout: ChatLayout ,
97
+ /// - originalAttributes: `ChatLayoutAttributes` that the `CollectionViewChatLayout ` is going to use.
98
+ func finalLayoutAttributesForDeletedItem( _ chatLayout: CollectionViewChatLayout ,
99
99
of kind: ItemKind ,
100
100
at indexPath: IndexPath ,
101
101
modifying originalAttributes: ChatLayoutAttributes )
@@ -106,33 +106,33 @@ public protocol ChatLayoutDelegate: AnyObject {
106
106
public extension ChatLayoutDelegate {
107
107
108
108
/// Default implementation returns: `false`.
109
- func shouldPresentHeader( _ chatLayout: ChatLayout ,
109
+ func shouldPresentHeader( _ chatLayout: CollectionViewChatLayout ,
110
110
at sectionIndex: Int ) -> Bool {
111
111
return false
112
112
}
113
113
114
114
/// Default implementation returns: `false`.
115
- func shouldPresentFooter( _ chatLayout: ChatLayout ,
115
+ func shouldPresentFooter( _ chatLayout: CollectionViewChatLayout ,
116
116
at sectionIndex: Int ) -> Bool {
117
117
return false
118
118
}
119
119
120
120
/// Default implementation returns: `ItemSize.auto`.
121
- func sizeForItem( _ chatLayout: ChatLayout ,
121
+ func sizeForItem( _ chatLayout: CollectionViewChatLayout ,
122
122
of kind: ItemKind ,
123
123
at indexPath: IndexPath ) -> ItemSize {
124
124
return . auto
125
125
}
126
126
127
127
/// Default implementation returns: `ChatItemAlignment.fullWidth`.
128
- func alignmentForItem( _ chatLayout: ChatLayout ,
128
+ func alignmentForItem( _ chatLayout: CollectionViewChatLayout ,
129
129
of kind: ItemKind ,
130
130
at indexPath: IndexPath ) -> ChatItemAlignment {
131
131
return . fullWidth
132
132
}
133
133
134
134
/// Default implementation sets a `ChatLayoutAttributes.alpha` to zero.
135
- func initialLayoutAttributesForInsertedItem( _ chatLayout: ChatLayout ,
135
+ func initialLayoutAttributesForInsertedItem( _ chatLayout: CollectionViewChatLayout ,
136
136
of kind: ItemKind ,
137
137
at indexPath: IndexPath ,
138
138
modifying originalAttributes: ChatLayoutAttributes ,
@@ -141,7 +141,7 @@ public extension ChatLayoutDelegate {
141
141
}
142
142
143
143
/// Default implementation sets a `ChatLayoutAttributes.alpha` to zero.
144
- func finalLayoutAttributesForDeletedItem( _ chatLayout: ChatLayout ,
144
+ func finalLayoutAttributesForDeletedItem( _ chatLayout: CollectionViewChatLayout ,
145
145
of kind: ItemKind ,
146
146
at indexPath: IndexPath ,
147
147
modifying originalAttributes: ChatLayoutAttributes ) {
0 commit comments