The control, which allow you to create group avatar for chat.
source 'git@github.com:dibelogrivaya/db-specs.git'
pod "DBChatAvatarView"
- Import
DBChatAvatarView.h
in your view. - Create a new
DBChatAvatarView
with Storyboards or via code.
DBChatAvatarView *chatAvatarView = [[DBChatAvatarView alloc] initWithFrame:frame];
[self.view addSubview:chatAvatarView];
- Implement protocol
DBChatAvatarViewDataSource
@protocol DBChatAvatarViewDataSource <NSObject>
- (NSInteger)numberOfUsersInChatAvatarView:(DBChatAvatarView *)chatAvatarView;
- (DBChatAvatarState)stateForAvatarAtIndex:(NSInteger)avatarIndex inChatAvatarView:(DBChatAvatarView *)chatAvatarView;
- (UIImage *)imageForAvatarAtIndex:(NSInteger)avatarIndex inChatAvatarView:(DBChatAvatarView *)chatAvatarView;
@end
- Reload
[chatAvatarView reloadAvatars];