Skip to content

Commit 1d3840e

Browse files
author
Eugene Kazaev
committed
Reformatted the code
1 parent bc297e1 commit 1d3840e

File tree

6 files changed

+7
-16
lines changed

6 files changed

+7
-16
lines changed

ChatLayout.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Pod::Spec.new do |s|
22
s.name = 'ChatLayout'
33
s.version = '1.2.2'
44
s.summary = 'Chat UI Library. It uses custom UICollectionViewLayout to provide you full control over the presentation.'
5-
s.swift_version = '5.2'
5+
s.swift_version = '5.7'
66

77
s.description = <<-DESC
88
ChatLayout is a Chat UI Library. It uses custom UICollectionViewLayout to provide you full control over the

ChatLayout/Classes/Core/Model/LayoutModel.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ struct LayoutModel {
139139
// MARK: To use only withing process(updateItems:)
140140

141141
mutating func insertSection(_ section: SectionModel, at sectionIndex: Int) {
142-
var sections = self.sections
142+
var sections = sections
143143
guard sectionIndex <= sections.count else {
144144
assertionFailure("Incorrect section index.")
145145
return

ChatLayout/Classes/Core/Model/ModelState.swift

-9
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,4 @@ enum ModelState: Hashable, CaseIterable {
1515

1616
case afterUpdate
1717

18-
func hash(into hasher: inout Hasher) {
19-
switch self {
20-
case .afterUpdate:
21-
hasher.combine(1)
22-
case .beforeUpdate:
23-
hasher.combine(0)
24-
}
25-
}
26-
2718
}

ChatLayout/Classes/Core/Model/StateController.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ final class StateController {
363363
assertionFailure("Item at index path (\(itemPath.section) - \(itemPath.item)) does not exist.")
364364
return
365365
}
366-
var layout = self.layout(at: state)
366+
var layout = layout(at: state)
367367
let previousFrame = item.frame
368368
cachedAttributesState = nil
369369
item.alignment = alignment
@@ -557,7 +557,7 @@ final class StateController {
557557
}
558558

559559
func contentSize(for state: ModelState) -> CGSize {
560-
let contentHeight = self.contentHeight(at: state)
560+
let contentHeight = contentHeight(at: state)
561561
guard contentHeight != 0 else {
562562
return .zero
563563
}
@@ -600,7 +600,7 @@ final class StateController {
600600
}
601601

602602
private func allAttributes(at state: ModelState, visibleRect: CGRect? = nil) -> [ChatLayoutAttributes] {
603-
let layout = self.layout(at: state)
603+
let layout = layout(at: state)
604604

605605
if let visibleRect = visibleRect {
606606
enum TraverseState {

Example/ChatLayout/Chat/Controller/DefaultChatController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ final class DefaultChatController: ChatController {
6767
}
6868

6969
private func appendConvertingToMessages(_ rawMessages: [RawMessage]) {
70-
var messages = self.messages
70+
var messages = messages
7171
messages.append(contentsOf: rawMessages)
7272
self.messages = messages.sorted(by: { $0.date.timeIntervalSince1970 < $1.date.timeIntervalSince1970 })
7373
}

Example/ChatLayout/Chat/Controller/Helpers/SetActor.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public final class SetActor<Option: SetAlgebra, ReactionType> {
8181
}
8282

8383
private func optionsChanged(oldOptions: Option) {
84-
let reactions = self.reactions
84+
let reactions = reactions
8585
let onChangeReactions = reactions.filter {
8686
guard case .onChange = $0.action else {
8787
return false

0 commit comments

Comments
 (0)