Inherits from | NSObject |
Declared in | JSAvatarImageFactory.h |
Overview
JSAvatarImageFactory
is a factory that provides a means for styling avatar images to be displayed in a JSBubbleMessageCell
of a JSMessagesViewController
.
Tasks
-
+ avatarImageNamed:croppedToCircle:
Returns the image object associated with the specified filename. The image is cropped to a circle if the value of croppedToCircle is
YES
, otherwise the image is cropped to a square. The image has a flat, iOS 7 appearance. -
+ avatarImage:croppedToCircle:
Returns a copy of the image object associated with the specified originalImage. The image is cropped to a circle if the value of croppedToCircle is
YES
, otherwise the image is cropped to a square. The image has a flat, iOS 7 appearance. -
+ classicAvatarImageNamed:croppedToCircle:
Returns the image object associated with the specified filename. The image is cropped to a circle if the value of croppedToCircle is
YES
, otherwise the image is cropped to a square. The image has a glossy, iOS 6 appearance.
Class Methods
avatarImage:croppedToCircle: 
+ (UIImage *)avatarImage:(UIImage *)originalImage croppedToCircle:(BOOL)croppedToCircle
Discussion
Returns a copy of the image object associated with the specified originalImage. The image is cropped to a circle if the value of croppedToCircle is YES
, otherwise the image is cropped to a square. The image has a flat, iOS 7 appearance.
Parameters
- originalImage
The origin image object to be styled for an avatar.
- croppedToCircle
A boolean value indicating whether or not the image should be cropped as a circle or square. Pass
YES
to crop to a circle, andNO
to crop to a square.
Return Value
A new image object for the specified originalImage (cropped as specified), or nil
if originalImage is not a valid, initialized image object.
Declared In
JSAvatarImageFactory.h
avatarImageNamed:croppedToCircle: 
+ (UIImage *)avatarImageNamed:(NSString *)filename croppedToCircle:(BOOL)croppedToCircle
Discussion
Returns the image object associated with the specified filename. The image is cropped to a circle if the value of croppedToCircle is YES
, otherwise the image is cropped to a square. The image has a flat, iOS 7 appearance.
Parameters
- filename
The name of the file. If this is the first time the image is being loaded, the method looks for an image with the specified name in the application’s main bundle.
- croppedToCircle
A boolean value indicating whether or not the image should be cropped as a circle or square. Pass
YES
to crop to a circle, andNO
to crop to a square.
Return Value
The image object for the specified file (cropped as specified), or nil
if the method could not find the specified image.
Declared In
JSAvatarImageFactory.h
classicAvatarImageNamed:croppedToCircle: 
+ (UIImage *)classicAvatarImageNamed:(NSString *)filename croppedToCircle:(BOOL)croppedToCircle
Discussion
Returns the image object associated with the specified filename. The image is cropped to a circle if the value of croppedToCircle is YES
, otherwise the image is cropped to a square. The image has a glossy, iOS 6 appearance.
Parameters
- filename
The name of the file. If this is the first time the image is being loaded, the method looks for an image with the specified name in the application’s main bundle.
- croppedToCircle
A boolean value indicating whether or not the image should be cropped as a circle or square. Pass
YES
to crop to a circle, andNO
to crop to a square.
Return Value
The image object for the specified file (cropped as specified), or nil
if the method could not find the specified image.
Declared In
JSAvatarImageFactory.h