Code Monkey home page Code Monkey logo

cddgroupavatar's Introduction

CDDGroupAvatar

CocoaPods CocoaPods 

这框架的初衷是想使群头像的实现尽可能的能像SDWebImage加载一张图片那么简单

Swift版本:

Swift版本传送门

博客地址:

iOS 群头像框架 — CDDGroupAvatar

GIF

安装:

  • CocoaPods

1:在 Podfile 中添加 pod 'CDDGroupAvatar',执行 pod install 或 pod update。

  • 如果只需要无缓存版本:pod 'CDDGroupAvatar/NoCache,更多详情可以查看podspec文件

  • 手动导入

1:将demo项目中的 CDDGroupAvatar 文件夹所有内容拖入你的工程中。 2:集成 SDWebImage 框架。

  • 用法

1:导入#import <CDDGroupAvatar/DCAvatar.h>可以拥有全部功能。 2:调用对应控件的类方法。 3:如果有使用上的疑问,可以下载演示demo进行查看。

代码:

#import <CDDGroupAvatar/DCAvatar.h>
...

// UIImageView
[self.avImageViewW8 dc_setImageAvatarWithGroupId:@"avImageViewW8" Source:_groupNum8];

// UIButton
// Image
[self.avaButton dc_setImageAvatarWithGroupId:@"avaButton" Source:_groupNum9 forState:0];
// Background
[self.avaBgButton dc_setBackgroundImageAvatarWithGroupId:@"avaBgButton" Source:_groupNum4 forState:0];

版本更新

version note
1.1.0 Start ~ 🤔
1.2.0 Add Methods;Fix Bug。
1.3.0 支持ImageView和Button,初步完成框架。博客
1.4.0 Add:同步获取所有小头像方法;
1.5.2 Add:新增无缓存版本,type - NoCache,去除SDWebImage依赖。博客
1.5.3 Remove:SDWebImage默认版本。
1.5.4 Add:QQ_Type:Image切圈。
1.5.6 Add:自定义缓存cache

1.4.0:

/**
 批量加载群内部小头像(同步-M)
 
 @param groupSource 群头像数据源数组
 @param placeholder 占位图 例:@[@"p1",@"p2"] 或者 @[image1,image2] 权重大于 placeholderImage属性
 */
+ (NSArray *)dc_synfetchLoadImageSource:(NSArray *)groupSource itemPlaceholder:(id)placeholder;

/**
 批量加载群内部小头像(异步-M)
 
 @param groupSource 群头像数据源数组
 @param placeholder 占位图 例:@[@"p1",@"p2"] 或者 @[image1,image2] 权重大于 placeholderImage属性
 */
+ (void)dc_asynfetchLoadImageSource:(NSArray *)groupSource itemPlaceholder:(id)placeholder completedBlock:(AsynFetchImageBlock)completedBlock;

1.5.2:

提供NoCache版本,脱离SDWebImage依赖,用户可自行决定加载方式和缓存
[self.ncImageViewW4 dc_setNoCacheImageAvatarWithGroupId:@"avImageViewW4" Source:@[[UIImage imageNamed:@"noCache1"],[UIImage imageNamed:@"noCache2"],[UIImage imageNamed:@"noCache3"],[UIImage imageNamed:@"noCache4"]]];

关于版本:

目前iOSSwift版本均已开源,后续会继续优化完善~

欢迎 Star✨

Agreement

  • CDDGroupAvatar licensed under the MIT license is used. Refer to LICENSE for more information.

cddgroupavatar's People

Contributors

rocketschen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cddgroupavatar's Issues

是否考虑加一个内边距?

大佬, 可以添加一个内边距吗?
我看您的代码里面是使用的distanceBetweenAvatar 来作为两边边距的, 但其实在业务场景有可能需要控制内边距

期望: 添加一个 UIEdgeInset 属性, 可以控制 头像距离容器的上下左右边距

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.