UIImageView-Gravatar 1.0

UIImageView-Gravatar 1.0

测试已测试
Lang语言 Obj-CObjective C
许可 MIT
Released最新版本2014年12月

ruddfawcett维护。



  • Rex Finn

RFGravatarImageView

一个简单的 UIImageView 子类,用于处理 http://gravatar.com 图片。

安装

Podfile

platform :ios, '7.0'
pod "RFGravatarImageView", "~> 1.0"

使用

RFGravatarImageView 非常容易使用。请参阅以下示例实现(从演示项目复制/粘贴)。

_imageView = [[RFGravatarImageView alloc] initWithFrame:self.view.bounds];
[_imageView setEmail:@"[email protected]"];
[_imageView setSize:1024];

[self.view addSubview:_imageView];

[_imageView loadGravatar];

查看RFGravatarImageView.h 以查看每个可用方法和变量 - 我对所有需要的信息都进行了注释(我认为)。有关 Gravatar 图像请求的更多信息,请参阅此处

希望您喜欢它!请 Fork 并发送 Pull Requests!

方法和变量

// I suppose you could use an NSDictionary for this, but I was lazy - feel free to add.

// User email - you must set this!
@property (readwrite, strong, nonatomic) NSString *email;

// A placeholder image while SDWebImage fetches the gravatar.
@property (readwrite, strong, nonatomic) UIImage *placeholder;

// The size of the gravatar up to 2048. All gravatars are squares, so you will get 2048x2048.
@property (readwrite, nonatomic) NSUInteger size;

// Rating (G, PG, R, X) of gravatar to allow, helpful for kid-friendly apps.
@property (readwrite, nonatomic) GravatarRatings rating;

// If email doesn't have a gravatar, use one of these... http://bit.ly/1cCmtdb
@property (readwrite, nonatomic) DefaultGravatars defaultGravatar;

// Force a default gravatar, whether or not email has gravatar. Remember to set defaultGravatar too!
@property (readwrite, nonatomic) BOOL forceDefault;

// Another option to init with a placeholder, so you don't have to do [_imageView setPlaceholder:].
- (id)initWithFrame:(CGRect)frame andPlaceholder:(UIImage*)placeholder;

// A substitute to having to do [_imageView setForceDefault:YES]; and setting the default gravatar.
- (void)forceDefault:(BOOL)forceDefault withDefaultGravatar:(DefaultGravatars)gravatar;

// Actually loads the gravatar AFTER you have configured all of your options.
- (void)loadGravatar;

// Load gravatar with completion block
- (void)loadGravatar:(void (^)(void))completed;

// Refreshes the gravatar, you can set new paramters between loading it and refreshing it.
- (void)refreshGravatar;

屏幕截图

RFGravatarImageView

许可

MIT 许可证 (MIT)

版权所有 (c) 2013 Rudd Fawcett

特此授予任何人免费取得并使用此软件以及其相关文档文件(“软件”)的副本的权利,不受任何限制,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或出售软件副本的权利,并允许向获得软件副本的个人提供这些权利,前提是必须遵守以下条件

上述版权声明和本许可声明应包含在实际或实质部分的软件副本中。

软件按“原样”提供,不提供任何明示或暗示的保证,包括但不限于适销性、适用于特定目的和不侵犯专用权。在任何情况下,作者或版权所有者均不对任何索赔、损害或其他责任负责,无论这些索赔、损害或其他责任是因合同、侵权或其他方式引起的,与软件或其使用或处理有关。