You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.
You'll have to call functions on NMessenger instead of NMessengerViewController for this.
To clear all messages without animation, you can use self.messengerView.clearALLMessages() in NMessengerViewController. Reloading messages is harder since it's not the typical "tableView with data source" model. To reload data you'll have to add all of the messages again. There are a few functions in NMessenger which make it easy to add an array of messages, but you'll have to create those messages first. For example:
/** Adds an array of messages to the messenger. - parameter messages: An array of messages - parameter scrollsToMessage: If marked true, the tableview will scroll to the newly added - parameter animation: An animation for newly added messages - parameter completion: A completion handler */publicfunc addMessagesWithBlock(messages:[GeneralMessengerCell], scrollsToMessage:Bool, withAnimation animation:UITableViewRowAnimation, completion:(()->Void)?)
would be called with self.messengerView.addMessagesWithBlock(...).
There aren't any public functions in NMessengerViewController which solely create GeneralMessengerCells for text, image, etc. Would it be helpful to expose those functions?
Thanks a lot for the reply. After reading your comment I checked NMessengerViewController.swift source code and found a function called postText() which generates a GeneralMessengerCell. Then I called addMessagesWithBlock() and it's finally working.
Hi, I want to clear message and reload data without animation and without scrolling. is that possible only with just sendText()?
The text was updated successfully, but these errors were encountered: