Comments (3)
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
*/
public func 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 GeneralMessengerCell
s for text, image, etc. Would it be helpful to expose those functions?
from nmessenger.
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.
from nmessenger.
Cool. I think I'm still going to make those functions public.
from nmessenger.
Related Issues (20)
- NMessenger With SwiftR HOT 1
- Text Count
- Contents are not showing properly and I want to set the border for message view. HOT 5
- Adding image from Gallery hides the my custom view and chat.
- Crash when attempt to send collectionView. HOT 2
- Next release? HOT 1
- Message full width of screen HOT 5
- emojis are not showing properly
- Scroll to last Item Bug HOT 5
- Collection view with custom views not working HOT 2
- Head Prefetching Batch Fetch Content HOT 1
- Need to show message cell from bottom to top for chat messages. HOT 1
- How to show loading indicator at top & change scroll direction from bottom to top for load more? HOT 1
- Asyncdisplaykit not updated HOT 3
- AddToGroup breaks with Texture 2.4.0 HOT 1
- Update cell data HOT 3
- Chat bubble is shown only partially HOT 1
- how can i make a multiple select system?
- Updated swfit 4.2 Seems Like Texture is requesting for AssetsLibrary, update pods
- Data race crashes application
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nmessenger.