/DBChatAvatarSample

Sample for DBChatAvatarView - a control, which allow you to create group avatar for a chat.

Primary LanguageObjective-CMIT LicenseMIT

DBChatAvatarSample

Sample for DBChatAvatarView - a control, which allow you to create group avatar for a chat.

Screenshot

Sample screen

Installation

Copy files DBChatAvatarView, DBAvatarView and category UIColor+HEX into your project.

Usage

  • 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];

Requirements

  • iOS >= 7.0
  • ARC

License

DBChatAvatarSample is available under the MIT license. See the LICENSE file for more info.