Skip to content

Commit 444e2cb

Browse files
committed
Updated readme with sample code
1 parent 8ad43f8 commit 444e2cb

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ UIImageView+Letters
33

44
An 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

1515
In 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

2744
Using the MIT license. See license file for details.

0 commit comments

Comments
 (0)