Skip to content

Commit

Permalink
Release version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ekazaev committed Jan 5, 2021
1 parent 7745b21 commit 42ab870
Show file tree
Hide file tree
Showing 96 changed files with 268 additions and 155 deletions.
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
--exponentgrouping disabled
--fractiongrouping disabled
--fragment false
--header "\nChatLayout\n{file}\nhttps://github.com/ekazaev/ChatLayout\n\nCreated by Eugene Kazaev in {year}.\nDistributed under the MIT license.\n"
--header "\nChatLayout\n{file}\nhttps://github.com/ekazaev/ChatLayout\n\nCreated by Eugene Kazaev in 2020-{year}.\nDistributed under the MIT license.\n"
--hexgrouping none
--hexliteralcase uppercase
--ifdef no-indent
Expand Down
1 change: 1 addition & 0 deletions .swiftlint.yml
10 changes: 5 additions & 5 deletions ChatLayout.podspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|
s.name = 'ChatLayout'
s.version = '0.6.3'
s.summary = 'An alternative solution to MessageKit. It uses custom UICollectionViewLayout to provide you full control over the presentation.'
s.version = '1.0.0'
s.summary = 'Chat UI Library. An alternative solution to MessageKit. It uses custom UICollectionViewLayout to provide you full control over the presentation.'
s.swift_version = '5.2'

s.description = <<-DESC
ChatLayout is an alternative solution to MessageKit. It uses custom
UICollectionViewLayout to provide you full control over the presentation as well as all the tools available in
UICollectionView. It supports dynamic cells and supplementary view sizes.
ChatLayout is a Chat UI Library. It uses custom UICollectionViewLayout to provide you full control over the
presentation as well as all the tools available in UICollectionView. It supports dynamic cells and
supplementary view sizes.
DESC

s.homepage = 'https://github.com/ekazaev/ChatLayout'
Expand Down
2 changes: 1 addition & 1 deletion ChatLayout/Classes/Core/ChatItemAlignment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ChatItemAlignment.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down
12 changes: 6 additions & 6 deletions ChatLayout/Classes/Core/ChatLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ChatLayout.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down Expand Up @@ -413,7 +413,7 @@ public final class ChatLayout: UICollectionViewLayout {
guard let collectionView = collectionView,
oldBounds.width != collectionView.bounds.width,
keepContentOffsetAtBottomOnBatchUpdates,
controller.isLayoutBiggerThanScreen(at: state) else {
controller.isLayoutBiggerThanVisibleBounds(at: state) else {
return
}
let newBounds = collectionView.bounds
Expand Down Expand Up @@ -617,7 +617,7 @@ public final class ChatLayout: UICollectionViewLayout {
controller.proposedCompensatingOffset = 0

if keepContentOffsetAtBottomOnBatchUpdates,
controller.isLayoutBiggerThanScreen(at: state),
controller.isLayoutBiggerThanVisibleBounds(at: state),
controller.batchUpdateCompensatingOffset != 0,
let collectionView = collectionView {
let compensatingOffset: CGFloat
Expand Down Expand Up @@ -692,7 +692,7 @@ public final class ChatLayout: UICollectionViewLayout {
attributes = controller.itemAttributes(for: itemPath, kind: .cell, at: .beforeUpdate)?.typedCopy() ?? ChatLayoutAttributes(forCellWith: itemIndexPath)
controller.offsetByTotalCompensation(attributes: attributes, for: state, backward: false)
if keepContentOffsetAtBottomOnBatchUpdates,
controller.isLayoutBiggerThanScreen(at: state),
controller.isLayoutBiggerThanVisibleBounds(at: state),
let attributes = attributes {
attributes.frame = attributes.frame.offsetBy(dx: 0, dy: attributes.frame.height / 2)
}
Expand Down Expand Up @@ -784,7 +784,7 @@ public final class ChatLayout: UICollectionViewLayout {
attributes = controller.itemAttributes(for: elementPath, kind: kind, at: .beforeUpdate)?.typedCopy() ?? ChatLayoutAttributes(forSupplementaryViewOfKind: elementKind, with: elementIndexPath)
controller.offsetByTotalCompensation(attributes: attributes, for: state, backward: false)
if keepContentOffsetAtBottomOnBatchUpdates,
controller.isLayoutBiggerThanScreen(at: state),
controller.isLayoutBiggerThanVisibleBounds(at: state),
let attributes = attributes {
attributes.frame = attributes.frame.offsetBy(dx: 0, dy: attributes.frame.height / 2)
}
Expand Down Expand Up @@ -885,7 +885,7 @@ extension ChatLayout {

extension ChatLayout: ChatLayoutRepresentation {

func numberOfItems(inSection section: Int) -> Int {
func numberOfItems(in section: Int) -> Int {
guard let collectionView = collectionView else {
return .zero
}
Expand Down
2 changes: 1 addition & 1 deletion ChatLayout/Classes/Core/ChatLayoutAttributes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ChatLayoutAttributes.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down
2 changes: 1 addition & 1 deletion ChatLayout/Classes/Core/ChatLayoutDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ChatLayoutDelegate.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ChatLayoutInvalidationContext.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down
2 changes: 1 addition & 1 deletion ChatLayout/Classes/Core/ChatLayoutPositionSnapshot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ChatLayoutPositionSnapshot.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down
2 changes: 1 addition & 1 deletion ChatLayout/Classes/Core/ChatLayoutSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ChatLayoutSettings.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down
2 changes: 1 addition & 1 deletion ChatLayout/Classes/Core/Extensions/CGRect+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// CGRect+Extension.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// IndexPath+Extension.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down
2 changes: 1 addition & 1 deletion ChatLayout/Classes/Core/Model/ItemKind.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ItemKind.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down
2 changes: 1 addition & 1 deletion ChatLayout/Classes/Core/Model/ItemModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ItemModel.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down
2 changes: 1 addition & 1 deletion ChatLayout/Classes/Core/Model/ItemPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ItemPath.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down
2 changes: 1 addition & 1 deletion ChatLayout/Classes/Core/Model/ItemSize.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ItemSize.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down
2 changes: 1 addition & 1 deletion ChatLayout/Classes/Core/Model/LayoutModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// LayoutModel.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down
2 changes: 1 addition & 1 deletion ChatLayout/Classes/Core/Model/ModelState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ModelState.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand Down
8 changes: 6 additions & 2 deletions ChatLayout/Classes/Core/Model/SectionModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SectionModel.swift
// https://github.com/ekazaev/ChatLayout
//
// Created by Eugene Kazaev in 2020.
// Created by Eugene Kazaev in 2020-2021.
// Distributed under the MIT license.
//

Expand All @@ -29,7 +29,11 @@ struct SectionModel {
}

var frame: CGRect {
return CGRect(x: 0, y: offsetY, width: collectionLayout.visibleBounds.width - collectionLayout.settings.additionalInsets.left - collectionLayout.settings.additionalInsets.right, height: height)
let additionalInsets = collectionLayout.settings.additionalInsets
return CGRect(x: 0,
y: offsetY,
width: collectionLayout.visibleBounds.width - additionalInsets.left - additionalInsets.right,
height: height)
}

var height: CGFloat {
Expand Down
Loading

0 comments on commit 42ab870

Please sign in to comment.