RBImageCenter Class Reference
Inherits from | NSObject |
---|---|
Declared in | RBImageCenter.h |
memoryCache
The underlying NSCache
that is used to cache images processed by RBImageCenter
. By default the cache size is 100 MB.
@property (nonatomic, readonly, nonnull) NSCache *memoryCache
Discussion
The underlying NSCache
that is used to cache images processed by RBImageCenter
. By default the cache size is 100 MB.
Declared In
RBImageCenter.h
+ shared
The shared singleton.
+ (nonnull RBImageCenter *)shared
Discussion
The shared singleton.
Declared In
RBImageCenter.h
+ resizableImageWithName:withInsets:
Gets a resizable image from the bundle.
+ (nullable UIImage *)resizableImageWithName:(nonnull NSString *)name withInsets:(UIEdgeInsets)insets
Parameters
name |
The name of the image in the bundle. |
---|---|
insets |
The fixed edge insets to use for the resizeable image. |
Return Value
The retrieved image.
Discussion
Gets a resizable image from the bundle.
Declared In
RBImageCenter.h
+ bundleImageWithName:
Gets an image from the bundle.
+ (nullable UIImage *)bundleImageWithName:(nonnull NSString *)name
Parameters
name |
The name of the image in the bundle. |
---|
Return Value
The retrieved image.
Discussion
Gets an image from the bundle.
Declared In
RBImageCenter.h
+ imageWithPath:
Gets an image from the given filesystem path.
+ (nullable UIImage *)imageWithPath:(nonnull NSString *)path
Parameters
path |
The path of the image in the filesystem. |
---|
Return Value
The retrieved image.
Discussion
Gets an image from the given filesystem path.
Declared In
RBImageCenter.h
– glyphImageWithName:tintColor:size:
Gets a glyph image from the bundle, optionally with a specified color or size.
- (nullable UIImage *)glyphImageWithName:(nonnull NSString *)name tintColor:(nullable UIColor *)tintColor size:(nullable NSNumber *)size
Parameters
name |
The name of the glyph image in the bundle. |
---|---|
tintColor |
The optional color with which to tint the glyph. |
size |
The optional size (specified in height points) with which to scale the glyph. |
Return Value
The requested glyph image.
Discussion
Gets a glyph image from the bundle, optionally with a specified color or size.
Declared In
RBImageCenter.h
– imageWithRequest:completion:
Retrieves a decoded image asynchronously over HTTP using the request given.
- (nullable id<RBCancellableTask>)imageWithRequest:(nonnull NSURLRequest *)request completion:(nonnull void ( ^ ) ( RBImageResponse *__nonnull response ))completion
Parameters
request |
The network request to use for retrieval. |
---|---|
completion |
The completion block to be called on completion or failure. Must not be |
Return Value
A cancellation object or nil
if a request was not made as the image was locally available (via cache).
Discussion
Retrieves a decoded image asynchronously over HTTP using the request given.
Declared In
RBImageCenter.h
– imageWithRequest:beganReceivingResponse:progressUpdate:completion:
Retrieves a decoded image asynchronously over HTTP using the request given.
- (nullable id<RBCancellableTask>)imageWithRequest:(nonnull NSURLRequest *)request beganReceivingResponse:(nullable NetworkOperationBeganBlock)beganReceivingResponse progressUpdate:(nullable NetworkOperationProgressUpdateBlock)progressUpdate completion:(nonnull void ( ^ ) ( RBImageResponse *__nonnull response ))completion
Parameters
request |
The network request to use for retrieval. |
---|---|
beganReceivingResponse |
An optional block called at the beginning of the HTTP response. |
progressUpdate |
An optional block to be called to provide progress updates. |
completion |
The completion block to be called on completion or failure. Must not be |
Return Value
A cancellation object or nil
if a request was not made as the image was locally available (via cache).
Discussion
Retrieves a decoded image asynchronously over HTTP using the request given.
Declared In
RBImageCenter.h