File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ UIImageView+Letters
33
44An easy, helpful UIImageView category that generates letter initials as a placeholder for user profile images, with a randomized background color
55
6- ![ Example screenshot] ( http://i.imgur.com/nlH7ig0 .png )
6+ ![ Example screenshot] ( http://i.imgur.com/xSBjVQ7 .png )
77
88### Installation
99
@@ -14,14 +14,31 @@ An easy, helpful UIImageView category that generates letter initials as a placeh
1414
1515In the file where you want to use the category, be sure to import the file.
1616
17- ` #importUIImageView +Letter.h `
17+ ` #import UIImageView +Letter.h `
1818
19- Call the method ` setImageWithString:color: ` on any ` UIImageView ` instance to set the image.
19+ ##### Methods
20+
21+ Call the following methods on any ` UIImageView ` instance to set the image:
22+
23+ + ` - (void)setImageWithString:(NSString *)string `
24+ + ` - (void)setImageWithString:(NSString *)string color:(UIColor *)color `
2025
2126` string ` is the string used to generate the initials. This should be a user's full name if available.
2227
2328` color ` is an optional parameter that sets the background color of the image. Pass in ` nil ` to have a color automatically generated for you.
2429
30+ ##### Example
31+
32+ ```
33+ NSString *userName = @"Michael Bluth";
34+ UIImageView *myImgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 50, 50)];
35+ [myImgView setImageWithString:userName];
36+ ```
37+
38+ ### Future Goals
39+
40+ + CocoaPod support
41+
2542### License
2643
2744Using the MIT license. See license file for details.
You can’t perform that action at this time.
0 commit comments