ViButtonConfig
public struct ViButtonConfig
Configuration for buttons e.g. Find Similar, Action, etc
-
optional button text
Declaration
Swift
public var text: String = ""
-
font for button title label
Declaration
Swift
public var font: UIFont
-
will be used for text and tint color
Declaration
Swift
public var tintColor: UIColor
-
button image size
Declaration
Swift
public var size: CGSize
-
button background color
Declaration
Swift
public var backgroundColor: UIColor
-
button image
Declaration
Swift
public var icon : UIImage?
-
action to record for this button. The event will be recorded for analytics reporting tool action example: click, add_to_cart , add_to_wishlist
Declaration
Swift
public var actionToRecord : String? = nil
-
Constructor
- Parameters:
- text: button text
- font: button font
- tint_color: button tint color
- size: button size
- backgroundColor: button background color
- icon: button icon
- action_to_record: action to record for ViSenze tracking analytics e.g. for measuring CTR when user triggers an action after search
Declaration
Swift
public init(text : String = "", font: UIFont = ViTheme.sharedInstance.default_font, tint_color: UIColor = ViTheme.sharedInstance.default_btn_tint_color, size: CGSize = ViTheme.sharedInstance.default_btn_size, backgroundColor: UIColor = ViTheme.sharedInstance.default_btn_background_color, icon: UIImage? = nil, action_to_record: String? = nil )
Parameters
text
button text
font
button font
tint
_color: button tint color
size
button size
backgroundColor
button background color
icon
button icon
action
_to_record: action to record for ViSenze tracking analytics e.g. for measuring CTR when user triggers an action after search
- Parameters:
-
default button configuration
Declaration
Swift
public static var default_btn_config = ViButtonConfig()
-
default configuration for action button. Default to heart icon with tracked action set to add to wish list
Declaration
Swift
public static var default_action_btn_config = ViButtonConfig(