Simple chat view with data model.
Subclass the view controller you want to turn into a chat view.
@interface ViewController : WCSChatView
@end
- (void)sendMessage:(NSString *)message
{
WCSChatModel * model = [[WCSChatModel alloc] init];
model.timestamp = [NSDate date];
model.message = message;
model.type = WCSMessageTypeSent;
model.icon = [UIImage imageNamed:@"chat-user-0"];
WCSChatData * chatData = [WCSChatData new];
chatData.model = model;
[self.messages addObject:chatData];
[self.tableView reloadData];
}
This example is a quick and dirty way to build a chat view. It's missing a lot of features and is mostly not complete but shoud be a good starting point for your next chat project. The views also do not use constraints. Maybe later I will update that.
Twitter: @WrightsCS
If you are using this in your app, please let me know and I will add your app here!