Skip to content

Commit

Permalink
Fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ekazaev committed Sep 4, 2020
1 parent b7ca2a5 commit d283fa7
Show file tree
Hide file tree
Showing 71 changed files with 159 additions and 159 deletions.
2 changes: 1 addition & 1 deletion ChatLayout.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'ChatLayout'
s.version = '0.2.1'
s.version = '0.2.2'
s.summary = 'An alternative solution to MessageKit. It uses custom UICollectionViewLayout to provide you full control over the presentation.'
s.swift_version = '5.2'

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 @@ -18,7 +18,7 @@ import UIKit
///
/// `ChatLayout.settings`
///
/// `ChatLayout.keepContentOffestAtBottomOnBatchUpdates`
/// `ChatLayout.keepContentOffsetAtBottomOnBatchUpdates`
///
/// `ChatLayout.visibleBounds`
///
Expand Down Expand Up @@ -60,7 +60,7 @@ public final class ChatLayout: UICollectionViewLayout {
/// **NB:**
/// Keep in mind that if during the batch content inset changes also (e.g. keyboard frame changes), `ChatLayout` will usually get that information after
/// the animation starts and wont be able to compensate that change too. It should be done manually.
public var keepContentOffestAtBottomOnBatchUpdates: Bool = false
public var keepContentOffsetAtBottomOnBatchUpdates: Bool = false

/// The width and height of the collection view’s contents.
public override var collectionViewContentSize: CGSize {
Expand Down Expand Up @@ -362,7 +362,7 @@ public final class ChatLayout: UICollectionViewLayout {
public override func prepare(forAnimatedBoundsChange oldBounds: CGRect) {
guard let collectionView = collectionView,
oldBounds.width != collectionView.bounds.width,
keepContentOffestAtBottomOnBatchUpdates,
keepContentOffsetAtBottomOnBatchUpdates,
controller.contentHeight(at: state).rounded() > visibleBounds.height.rounded() else {
return
}
Expand Down Expand Up @@ -419,7 +419,7 @@ public final class ChatLayout: UICollectionViewLayout {
let isAboveBottomEdge = originalAttributes.frame.minY.rounded() <= visibleBounds.maxY.rounded()

if heightDifference != 0,
(keepContentOffestAtBottomOnBatchUpdates && controller.contentHeight(at: state).rounded() + heightDifference > visibleBounds.height.rounded())
(keepContentOffsetAtBottomOnBatchUpdates && controller.contentHeight(at: state).rounded() + heightDifference > visibleBounds.height.rounded())
|| isUserInitiatedScrolling || isAnimatedBoundsChange,
isAboveBottomEdge {
context.contentOffsetAdjustment.y += heightDifference
Expand Down Expand Up @@ -536,7 +536,7 @@ public final class ChatLayout: UICollectionViewLayout {
public override func finalizeCollectionViewUpdates() {
controller.proposedCompensatingOffset = 0

if keepContentOffestAtBottomOnBatchUpdates,
if keepContentOffsetAtBottomOnBatchUpdates,
controller.contentHeight(at: state).rounded() > visibleBounds.height.rounded(),
controller.batchUpdateCompensatingOffset != 0,
let collectionView = collectionView {
Expand Down Expand Up @@ -601,7 +601,7 @@ public final class ChatLayout: UICollectionViewLayout {
if controller.deletedIndexes.contains(itemIndexPath) || controller.deletedSectionsIndexes.contains(itemIndexPath.section) {
attributes = controller.itemAttributes(for: itemIndexPath, kind: .cell, at: .beforeUpdate) ?? ChatLayoutAttributes(forCellWith: itemIndexPath)
controller.offsetByTotalCompensation(attributes: attributes, for: state, backward: false)
if keepContentOffestAtBottomOnBatchUpdates,
if keepContentOffsetAtBottomOnBatchUpdates,
controller.contentHeight(at: state).rounded() > visibleBounds.height.rounded(),
let attributes = attributes {
attributes.frame = attributes.frame.offsetBy(dx: 0, dy: attributes.frame.height / 2)
Expand Down
10 changes: 5 additions & 5 deletions ChatLayout/Classes/Core/Model/StateController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protocol ChatLayoutRepresentation: AnyObject {

var adjustedContentInset: UIEdgeInsets { get }

var keepContentOffestAtBottomOnBatchUpdates: Bool { get }
var keepContentOffsetAtBottomOnBatchUpdates: Bool { get }

func numberOfItems(inSection section: Int) -> Int

Expand Down Expand Up @@ -563,7 +563,7 @@ final class StateController {
}

func offsetByTotalCompensation(attributes: UICollectionViewLayoutAttributes?, for state: ModelState, backward: Bool = false) {
guard collectionLayout.keepContentOffestAtBottomOnBatchUpdates,
guard collectionLayout.keepContentOffsetAtBottomOnBatchUpdates,
state == .afterUpdate,
let attributes = attributes else {
return
Expand Down Expand Up @@ -735,7 +735,7 @@ final class StateController {
}

private func compensateOffsetIfNeeded(for indexPath: IndexPath, kind: ItemKind, action: CompensatingAction) {
guard collectionLayout.keepContentOffestAtBottomOnBatchUpdates else {
guard collectionLayout.keepContentOffsetAtBottomOnBatchUpdates else {
return
}
switch action {
Expand Down Expand Up @@ -770,7 +770,7 @@ final class StateController {
}

private func compensateOffsetOfSectionIfNeeded(for sectionIndex: Int, action: CompensatingAction) {
guard collectionLayout.keepContentOffestAtBottomOnBatchUpdates else {
guard collectionLayout.keepContentOffsetAtBottomOnBatchUpdates else {
return
}
switch action {
Expand Down Expand Up @@ -808,7 +808,7 @@ final class StateController {
}

private func offsetByCompensation(frame: CGRect, indexPath: IndexPath, for state: ModelState, backward: Bool = false) -> CGRect {
guard collectionLayout.keepContentOffestAtBottomOnBatchUpdates,
guard collectionLayout.keepContentOffsetAtBottomOnBatchUpdates,
state == .afterUpdate,
contentHeight(at: .afterUpdate).rounded() > collectionLayout.visibleBounds.height.rounded() else {
return frame
Expand Down
2 changes: 1 addition & 1 deletion Example/ChatLayout/Chat/View/ChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ final class ChatViewController: UIViewController {
chatLayout.settings.interItemSpacing = 8
chatLayout.settings.interSectionSpacing = 8
chatLayout.settings.additionalInsets = UIEdgeInsets(top: 8, left: 5, bottom: 8, right: 5)
chatLayout.keepContentOffestAtBottomOnBatchUpdates = true
chatLayout.keepContentOffsetAtBottomOnBatchUpdates = true

collectionView = UICollectionView(frame: view.frame, collectionViewLayout: chatLayout)
view.addSubview(collectionView)
Expand Down
2 changes: 1 addition & 1 deletion Example/Tests/BasicCalculationsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class BasicCalculationsTests: XCTestCase {
lazy var visibleBounds: CGRect = CGRect(origin: .zero, size: viewSize)
lazy var layoutFrame: CGRect = visibleBounds
let adjustedContentInset: UIEdgeInsets = .zero
let keepContentOffestAtBottomOnBatchUpdates: Bool = true
let keepContentOffsetAtBottomOnBatchUpdates: Bool = true

func numberOfItems(inSection section: Int) -> Int {
return 100
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/CellLayoutContainerView.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 0.2.0 Docs
ChatLayout 0.2.1 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -458,7 +458,7 @@ <h4>Parameters</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-02)</p>
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-04)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
Expand Down
14 changes: 7 additions & 7 deletions docs/Classes/ChatLayout.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 0.2.0 Docs
ChatLayout 0.2.1 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -166,7 +166,7 @@ <h3 id='custom-properties' class='heading'>Custom Properties:</h3>

<p><code><a href="../Classes/ChatLayout.html#/s:10ChatLayoutAAC8settingsAA0aB8SettingsVvp">ChatLayout.settings</a></code></p>

<p><code><a href="../Classes/ChatLayout.html#/s:10ChatLayoutAAC39keepContentOffestAtBottomOnBatchUpdatesSbvp">ChatLayout.keepContentOffestAtBottomOnBatchUpdates</a></code></p>
<p><code><a href="../Classes/ChatLayout.html#/s:10ChatLayoutAAC39keepContentOffsetAtBottomOnBatchUpdatesSbvp">ChatLayout.keepContentOffsetAtBottomOnBatchUpdates</a></code></p>

<p><code><a href="../Classes/ChatLayout.html#/s:10ChatLayoutAAC13visibleBoundsSo6CGRectVvp">ChatLayout.visibleBounds</a></code></p>

Expand Down Expand Up @@ -295,9 +295,9 @@ <h4>Declaration</h4>
<li class="item">
<div>
<code>
<a name="/s:10ChatLayoutAAC39keepContentOffestAtBottomOnBatchUpdatesSbvp"></a>
<a name="//apple_ref/swift/Property/keepContentOffestAtBottomOnBatchUpdates" class="dashAnchor"></a>
<a class="token" href="#/s:10ChatLayoutAAC39keepContentOffestAtBottomOnBatchUpdatesSbvp">keepContentOffestAtBottomOnBatchUpdates</a>
<a name="/s:10ChatLayoutAAC39keepContentOffsetAtBottomOnBatchUpdatesSbvp"></a>
<a name="//apple_ref/swift/Property/keepContentOffsetAtBottomOnBatchUpdates" class="dashAnchor"></a>
<a class="token" href="#/s:10ChatLayoutAAC39keepContentOffsetAtBottomOnBatchUpdatesSbvp">keepContentOffsetAtBottomOnBatchUpdates</a>
</code>
</div>
<div class="height-container">
Expand All @@ -318,7 +318,7 @@ <h4>Declaration</h4>
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">keepContentOffestAtBottomOnBatchUpdates</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">keepContentOffsetAtBottomOnBatchUpdates</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>

</div>
</div>
Expand Down Expand Up @@ -1088,7 +1088,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-02)</p>
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-04)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/ChatLayoutAttributes.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 0.2.0 Docs
ChatLayout 0.2.1 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -390,7 +390,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-02)</p>
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-04)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/ChatLayoutInvalidationContext.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 0.2.0 Docs
ChatLayout 0.2.1 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -202,7 +202,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-02)</p>
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-04)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/ContainerCollectionReusableView.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 0.2.0 Docs
ChatLayout 0.2.1 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -378,7 +378,7 @@ <h4>Parameters</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-02)</p>
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-04)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/ContainerCollectionViewCell.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 0.2.0 Docs
ChatLayout 0.2.1 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -378,7 +378,7 @@ <h4>Parameters</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-02)</p>
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-04)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/EdgeAligningView.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 0.2.0 Docs
ChatLayout 0.2.1 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -362,7 +362,7 @@ <h4>Parameters</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-02)</p>
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-04)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/EdgeAligningView/Edge.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../../index.html">
ChatLayout 0.2.0 Docs
ChatLayout 0.2.1 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -282,7 +282,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-02)</p>
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-04)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/ImageMaskedView.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 0.2.0 Docs
ChatLayout 0.2.1 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -402,7 +402,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-02)</p>
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-04)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/MessageContainerView.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 0.2.0 Docs
ChatLayout 0.2.1 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -348,7 +348,7 @@ <h4>Parameters</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-02)</p>
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-04)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/RoundedCornersContainerView.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 0.2.0 Docs
ChatLayout 0.2.1 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -348,7 +348,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-02)</p>
<p>&copy; 2020 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2020-09-04)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
Expand Down
Loading

0 comments on commit d283fa7

Please sign in to comment.