Index

RBImageCenter.swift

Classes


RBImageCenter

The singleton center for the retrieval of images. Automatically caches images into memory. Set memoryCache.totalCostLimit to zero if you would not like to cache. If a cached image is used then any delegate methods will not be triggered only the completion will be called.

Properties

The shared singleton.
static public let shared RBImageCenter { get set }

The network client to use when downloading images over the network.
public var networkClient RBNetworkClient { get set }

The underlying NSCache that is used to cache images processed by RBImageCenter. By default the cache size is 100 MB.
public var memoryCache NSCache<NSString, UIImage> { get set }

Functions

Gets an image from the bundle.
@param name : The name of the image in the bundle.
@returns The retrieved image.
public class func bundleImage(withName name: String) -> UIImage?

Gets a resizable image from the bundle.
@param name : The name of the image in the bundle.
@param insets : The fixed edge insets to use for the resizeable image.
@returns The retrieved image.
public class func resizableImage(withName name: String, with insets: UIEdgeInsets) -> UIImage?

Gets an image from the given filesystem path.
@param path : The path of the image in the filesystem.
@returns The retrieved image.
public class func image(withPath path: String) -> UIImage?

Gets a glyph image from the bundle, optionally with a specified color or size.
@param name : The name of the glyph image in the bundle.
@param tintColor : The optional color with which to tint the glyph.
@param size : The optional size (specified in height points) with which to scale the glyph.
@returns The requested glyph image.
public func glyphImage(name: String, tintColor: UIColor?, size: Float?) -> UIImage?

Gets a glyph image from the bundle, optionally with a specified color or size.
@param name : The name of the glyph image in the bundle.
@param tintColor : The optional color with which to tint the glyph.
@param size : The optional size (specified in height points) with which to scale the glyph. Pass zero to ignore.
@returns The requested glyph image.
public func glyphImage(name: String, tintColor: UIColor?, size: Float) -> UIImage?

Removes any cached copy of an image at the given path.
@param path : The path of the image in the filesystem.
public func removeFromCache(path: String)

Removes any cached copy of an image at the given URLRequest.
@param request : The URLRequest that details the location of the image.
public func removeFromCache(request: URLRequest)