eBay / NMessenger

A fast, lightweight messenger component built on AsyncDisplaykit and written in Swift
Other
2.42k stars 272 forks source link

Scroll to last Item Bug #197

Open magicmikek opened 6 years ago

magicmikek commented 6 years ago

I extended my Messengerbarview with a Suggestion CollectionView on top. Now, I got a bug that the Collectionview does not scroll to the last item correctly and cuts off the messages.

message scroll bug

dodikk commented 6 years ago

This might be a duplicate of https://github.com/eBay/NMessenger/issues/172

dodikk commented 6 years ago

@magicmikek , it would be nice to have a snippet of your code which configures NMessenger

magicmikek commented 6 years ago

NMessenger is configured like the example Project

magicmikek commented 6 years ago

This is the scroll to last Message function:

open func scrollToLastMessage(animated: Bool) { waitForMessageLock { DispatchQueue.main.async { if let indexPath = self.pickLastIndexPath() { self.scrollToIndex((indexPath as NSIndexPath).row, inSection: (indexPath as NSIndexPath).section, atPosition: .bottom, animated: animated) } //unlock the semaphore self.state.messageLock.signal() } } }

kkaliher commented 6 years ago

looks like you need to account for iPhone X safe area in the constraints for your custom input bar. Look at NMessengerViewController keyboardNotification(_:)