VOCreationItemImageView
@interface VOCreationItemImageView : VOWebImageView
VOCreationItemImageView
is the view that is dropped into the VOEnvelopeView
of the VOVoucherCreationViewController
.
It represents a chosen VOPersonalizationOption
object by the creating VOUser
.
-
The type of personalization the
VOCreationItemImageView
represents.Declaration
Objective-C
@property (readonly, nonatomic) VOPersonalizationType type;
Swift
var type: VOPersonalizationType { get }
-
A subtype for the personalization to avoid ambiguity when two different
VOCreationItemImageView
s have the same type. If no subType is required, pass 0 for this value.Declaration
Objective-C
@property (readonly, nonatomic) NSInteger subType;
Swift
var subType: Int { get }
-
An id for the
VOCreationItemImageView
used to help identify the personalization object associated with it.Declaration
Objective-C
@property (readonly, nonatomic) NSInteger itemId;
Swift
var itemId: Int { get }
-
Whether this
VOCreationItemImageView
is editable.Declaration
Objective-C
@property (readonly, nonatomic) BOOL isEditable;
Swift
var isEditable: Bool { get }
-
Whether this
VOCreationItemImageView
can be removed from the envelope.Declaration
Objective-C
@property (readonly, nonatomic) BOOL isRemovable;
Swift
var isRemovable: Bool { get }
-
The border width of the
VOCreationItemImageView
.Declaration
Objective-C
@property (readonly, nonatomic) CGFloat borderWidth;
Swift
var borderWidth: CGFloat { get }
-
The border color of the
VOCreationItemImageView
.Declaration
Objective-C
@property (readonly, nonatomic) UIColor *borderColor;
Swift
var borderColor: UIColor! { get }
-
A url for a remote image that should be displayed in the
VOCreationItemImageView
.Declaration
Objective-C
@property (readonly, nonatomic) NSString *imageUrl;
Swift
var imageUrl: String! { get }
-
Initializer for creating a
VOCreationItemImageView
from a local image.Declaration
Objective-C
+ (instancetype)creationItemImageViewWithType:(VOPersonalizationType)type subType:(NSInteger)subType itemId:(NSInteger)itemId isEditable:(BOOL)isEditable isRemovable:(BOOL)isRemovable image:(UIImage *)image borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor;
Swift
convenience init!(type: VOPersonalizationType, subType: Int, itemId: Int, isEditable: Bool, isRemovable: Bool, image: UIImage!, borderWidth: CGFloat, borderColor: UIColor!)
Parameters
type
- The type of personalization.
subType
- The subtype of the personalization - optional parameter, default is 0.
itemId
- A unique identifier representing the personalization object, set by the Vouchr Server.
isEditable
- Whether or not the item can be modified from the edit screen.
isRemovable
- Determines whether or not the item can be deleted from the
VOVoucher
during the editing stage.image
- The image to be shown.
borderWidth
- How thick the border surrounding the image should be.
borderColor
- The color of the border surrounding the image.
Return Value
Instance of
VOCreationItemImageView
. -
+creationItemImageViewWithType:subType:itemId:isEditable:isRemovable:imageUrl:borderWidth:borderColor:
Initializer for creating a
VOCreationItemImageView
from a remote image url.Declaration
Objective-C
+ (instancetype)creationItemImageViewWithType:(VOPersonalizationType)type subType:(NSInteger)subType itemId:(NSInteger)itemId isEditable:(BOOL)isEditable isRemovable:(BOOL)isRemovable imageUrl:(NSString *)imageUrl borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor;
Swift
convenience init!(type: VOPersonalizationType, subType: Int, itemId: Int, isEditable: Bool, isRemovable: Bool, imageUrl: String!, borderWidth: CGFloat, borderColor: UIColor!)
Parameters
type
- The type of personalization.
subType
- The subtype of the personalization - optional parameter, default is 0.
itemId
- A unique identifier representing the personalization object, set by the Vouchr Server.
isEditable
- Whether or not the item can be modified from the edit screen.
isRemovable
- Determines whether or not the item can be deleted from the
VOVoucher
during the editing stage.imageUrl
- The remote url for the image to be shown.
borderWidth
- How thick the border surrounding the image should be.
borderColor
- The color of the border surrounding the image.
Return Value
Instance of
VOCreationItemImageView
. -
+creationItemImageViewWithType:subType:itemId:isEditable:isRemovable:viewToRenderAsImage:borderWidth:borderColor:
Initializer for creating a
VOCreationItemImageView
from a view.Declaration
Objective-C
+ (instancetype)creationItemImageViewWithType:(VOPersonalizationType)type subType:(NSInteger)subType itemId:(NSInteger)itemId isEditable:(BOOL)isEditable isRemovable:(BOOL)isRemovable viewToRenderAsImage:(UIView *)viewToRender borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor;
Swift
convenience init!(type: VOPersonalizationType, subType: Int, itemId: Int, isEditable: Bool, isRemovable: Bool, viewToRenderAsImage viewToRender: UIView!, borderWidth: CGFloat, borderColor: UIColor!)
Parameters
type
- The type of personalization.
subType
- The subtype of the personalization - optional parameter, default is 0.
itemId
- A unique identifier representing the personalization object, set by the Vouchr Server.
isEditable
- Whether or not the item can be modified from the edit screen.
isRemovable
- Determines whether or not the item can be deleted from the
VOVoucher
during the editing stage.viewToRender
- The view that will be rendered as an image.
borderWidth
- How thick the border surrounding the image should be.
borderColor
- The color of the border surrounding the image.
Return Value
Instance of
VOCreationItemImageView
. -
Creates a film strip frame for video thumbnails.
Declaration
Objective-C
+ (UIView *)filmStripFrameWithThumbnail:(UIImage *)thumbnail isYoutube:(BOOL)isYoutube;
Swift
class func filmStripFrame(withThumbnail thumbnail: UIImage!, isYoutube: Bool) -> UIView!
Parameters
thumbnail
- The image used to represent a video.
isYoutube
- Determines whether the video is a
VOYouTubeMedia
. If the video is aVOYouTubeMedia
, a red Youtube play button is added as an overlay to the video thumbnail. Otherwise, a white play button is applied.