SEssentialsDecoratedCachedView Class Reference

Inherits from SEssentialsDecoratedView : UIView
Declared in SEssentialsDecoratedCachedView.h
Availability
Related samples

Overview

The SEssentialsDecoratedCachedView creates a view that is a cached image of the view supplied. This can often be used to improve the speed of a carousel since it only has to transform an image and not a complex view.

To use a drop shadow effect without slowing down the framerate of a carousel use the following code in your datasource:

UIView *original = [ [ UIView alloc] initWithFrame:frame ];
original.layer.shadowRadius = 5;
SEssentialsDecoratedCachedView *cachedView = [ [ SEssentialsDecoratedCachedView alloc ] initWithView:original andMargin:UIEdgeInsetsMake(5,5,5,5) ];

Note: complex effects that use layer masks or OpenGL will not be cached by this class.

Properties

cachedView

The image view which is formed from view supplied in the constructor.

@property (nonatomic, readonly, retain) UIImageView *cachedView

Declared In

SEssentialsDecoratedCachedView.h

Instance Methods

initWithView:andMargin:

Create an SEssentialsDecoratedView from a view by capturing the image

- (instancetype)initWithView:(UIView *)view andMargin:(UIEdgeInsets)margin

Parameters

view

The view to be cached

margin

How much to extend the view frame, typically to capture drop shadow.

Declared In

SEssentialsDecoratedCachedView.h

refreshCachedView

Refresh the cached image from the view

- (void)refreshCachedView

Declared In

SEssentialsDecoratedCachedView.h