MessageKit Version: 0.13.2
iOS Version(s): 11.x, 10.x
Swift Version: 4
Always when I call messageInputBar.inputTextView.becomeFirstResponder() to activate the keyboard on viewDidAppear(), I got a crash in
public func scrollToBottom(animated: Bool = false) {
let collectionViewContentHeight = collectionViewLayout.collectionViewContentSize.height
performBatchUpdates(nil) { _ in
self.scrollRectToVisible(CGRect(0.0, collectionViewContentHeight - 1.0, 1.0, 1.0), animated: animated)
}
}
with this error stack
API error: <_UIKBCompatInputView: 0x139615760; frame = (0 0; 0 0); layer = <CALayer: 0x139615b90>> returned 0 width, assuming UIViewNoIntrinsicMetric
API error: <_UIKBCompatInputView: 0x139615760; frame = (0 0; 0 0); layer = <CALayer: 0x139615b90>> returned 0 width, assuming UIViewNoIntrinsicMetric
*** Assertion failure in -[MessageKit.MessagesCollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3698.34.4/UICollectionView.m:6011
I notice this happens only when I have one message
The keyboard open when I enter in the viewController
@BrenoVin , Could you provide backtrace stack and can reproduce in Example project? The error you posted is maybe Apple Internal error,see SR-5484

`â–¿ 43 elements
@BrenoVin , Thanks for your crash log, I fount that it is a uncaught exception, can you provide the exception name and reason part?
ex:
* Assertion failure in -[CollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3512.60.7/UICollectionView.m:4625 * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (76) must be equal to the number of items contained in that section before the update (70), plus or minus the number of items inserted or deleted from that section (5 inserted, 2 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).'
Of course I can @zhongwuzw


*** Assertion failure in -[MessageKit.MessagesCollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3698.52.10/UICollectionView.m:6015
@BrenoVin , 😂, maybe I didn't state clearly, I mean uncaught exception's name and reason, ex:

Sorry @zhongwuzw 😞:
2018-04-04 21:27:34.551002-0300 Poppin[3447:844158] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of sections. The number of sections contained in the collection view after the update (2) must be equal to the number of sections contained in the collection view before the update (1), plus or minus the number of sections inserted or deleted (0 inserted, 0 deleted).'
@zhongwuzw did you can see this bug?
@BrenoVin This looks like a bit of a red herring to me. Can you show me how you're inserting new messages/sections and reloading your view?
@BrenoVin , sorry for my ignore. scrollTobottom method uses performBatchUpdates, it would leads to dataSource assertion. Refer to your log, the reason is the dataSource operation, can you post dataSource related code? or Example project can reproduce?
Thanks about the answers.. I was looking at my code and found some shit stuff 👎There's no problem/bug with the library.
thank's again! :D