CreationItemImageView

@interface CreationItemImageView : VouchrWebImageView

CreationItemImageView is the view that is dropped into the EnvelopeView of the VoucherCreationViewController. It represents a chosen PersonalizationOption object by the creating User.

  • The type of personalization the CreationItemImageView represents.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PersonalizationType type;

    Swift

    var type: PersonalizationType { get }
  • A subtype for the personalization to avoid ambiguity when two different CreationItemImageViews 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 CreationItemImageView 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 CreationItemImageView is editable.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL isEditable;

    Swift

    var isEditable: Bool { get }
  • Whether this CreationItemImageView can be removed from the envelope.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL isRemovable;

    Swift

    var isRemovable: Bool { get }
  • The border width of the CreationItemImageView.

    Declaration

    Objective-C

    @property (readonly, nonatomic) CGFloat borderWidth;

    Swift

    var borderWidth: CGFloat { get }
  • The border color of the CreationItemImageView.

    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 CreationItemImageView.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *imageUrl;

    Swift

    var imageUrl: String! { get }
  • Initializer for creating a CreationItemImageView from a local image.

    Declaration

    Objective-C

    + (instancetype)creationItemImageViewWithType:(PersonalizationType)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: PersonalizationType, 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 Voucher 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 CreationItemImageView.

  • Initializer for creating a CreationItemImageView from a remote image url.

    Declaration

    Objective-C

    + (instancetype)creationItemImageViewWithType:(PersonalizationType)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: PersonalizationType, 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 Voucher 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 CreationItemImageView.

  • Initializer for creating a CreationItemImageView from a view.

    Declaration

    Objective-C

    + (instancetype)creationItemImageViewWithType:(PersonalizationType)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: PersonalizationType, 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 Voucher 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 CreationItemImageView.

  • 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 YoutubeMedia. If the video is a YoutubeMedia, a red Youtube play button is added as an overlay to the video thumbnail. Otherwise, a white play button is applied.